/** * Copyright 2012 Thinkbox Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file contains samples of how the library should be used to generate * and read data from PRT files. */ #include #include #include #include #include #if !defined(__APPLE__) && !defined(WIN32) && !defined(_WIN64) && __WORDSIZE == 64 #define INT64 long int #else #define INT64 long long #endif void layout_reading( const std::string& filePath ){ struct{ float pos[3]; float vel[3]; float col[3]; float density; INT64 id; } theParticle = { {0,0,0}, {0,0,0}, {1.f,1.f,1.f}, 0.f, -1 }; prtio::prt_ifstream stream( filePath ); const prtio::prt_layout& layout = stream.layout(); size_t numChannels = layout.num_channels(); for (size_t i=0;i