#include <OSGRAWSceneFileType.h>
Inheritance diagram for osg::RAWSceneFileType:

Write | |
| *virtual bool | write (const NodePtr &node, std::ostream &os, const Char8 *fileNameOrExtension) const |
| virtual bool | writeFile (const NodePtr &node, const Char8 *fileName) const |
Public Types | |
| typedef std::vector< FieldContainerPtr > | FCPtrStore |
Public Member Functions | |
Destructors | |
| *virtual | ~RAWSceneFileType (void) |
Get | |
| *virtual const Char8 * | getName (void) const |
Read | |
| *virtual NodePtr | read (std::istream &is, const Char8 *fileNameOrExtension) const |
Static Public Member Functions | |
Static Get | |
| *static RAWSceneFileType & | the (void) |
Protected Member Functions | |
Constructors | |
| * | RAWSceneFileType (const Char8 *suffixArray[], UInt16 suffixByteCount, bool override, UInt32 overridePriority, UInt32 flags) |
| RAWSceneFileType (const RAWSceneFileType &obj) | |
Static Protected Attributes | |
Member | |
| *static const Char8 * | _suffixA [] = {"raw"} |
| static RAWSceneFileType | _the |
Private Types | |
| typedef SceneFileType | Inherited |
Private Member Functions | |
| void | operator= (const RAWSceneFileType &source) |
| prohibit default function (move to 'public' if needed) | |
Definition at line 54 of file OSGRAWSceneFileType.h.
|
|
Definition at line 115 of file OSGRAWSceneFileType.h. |
|
|
Reimplemented in osg::OSGSceneFileType, and osg::VRMLSceneFileType. Definition at line 65 of file OSGSceneFileType.h. |
|
|
Definition at line 78 of file OSGSceneFileType.h. 00079 { 00080 OSG_READ_SUPPORTED = 1, 00081 OSG_WRITE_SUPPORTED = 2 00082 };
|
|
|
Definition at line 348 of file OSGRAWSceneFileType.cpp.
|
|
||||||||||||||||||||||||
|
constructors & destructors Definition at line 277 of file OSGRAWSceneFileType.cpp. 00281 : 00282 SceneFileType(suffixArray, 00283 suffixByteCount, 00284 override, 00285 overridePriority, 00286 flags) 00287 { 00288 }
|
|
|
constructors & destructors Definition at line 321 of file OSGRAWSceneFileType.cpp. 00321 : 00322 SceneFileType(obj) 00323 { 00324 return; 00325 }
|
|
|
Definition at line 290 of file OSGRAWSceneFileType.cpp. References _the. 00291 { 00292 return _the; 00293 }
|
|
|
Implements osg::SceneFileType. Definition at line 295 of file OSGRAWSceneFileType.cpp.
|
|
||||||||||||
|
Reimplemented from osg::SceneFileType. Definition at line 124 of file OSGRAWSceneFileType.cpp. References osg::FieldBits::AllFields, osg::beginEditCP(), osg::Node::CoreFieldMask, osg::SimpleMaterialBase::create(), osg::GeoProperty< GeoPropertyDesc >::create(), osg::GeometryBase::create(), osg::Node::create(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::crossThis(), osg::endEditCP(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::VecStorage3< ValueTypeT >::setValues(), and SNOTICE. 00125 { 00126 NodePtr root; 00127 GeometryPtr geo; 00128 GeoPositions3f::PtrType points; 00129 GeoNormals3f::PtrType normals; 00130 GeoIndicesUI32Ptr index; 00131 GeoPLengthsUI32Ptr lens; 00132 GeoPTypesUI8Ptr type; 00133 Vec3f vec[3]; 00134 UInt32 i = 0, n, triCount = 0; 00135 Real32 x,y,z; 00136 00137 fprintf(stderr, "Loading using Loader 0\n"); 00138 00139 if(is) 00140 { 00141 root = Node::create(); 00142 geo = Geometry::create(); 00143 00144 beginEditCP(geo, FieldBits::AllFields); 00145 beginEditCP(root, Node::CoreFieldMask); 00146 root->setCore( geo ); 00147 endEditCP(root, Node::CoreFieldMask); 00148 00149 points = GeoPositions3f::create(); 00150 geo->setPositions( points ); 00151 normals = GeoNormals3f::create(); 00152 geo->setNormals ( normals ); 00153 00154 triCount = i = 0; 00155 00156 beginEditCP(points, FieldBits::AllFields); 00157 beginEditCP(normals, FieldBits::AllFields); 00158 00159 while (1) { 00160 is >> x >> y >> z; 00161 if (is.eof()) 00162 break; 00163 else { 00164 points->getFieldPtr()->push_back( Pnt3f ( x, y, z) ); 00165 vec[i].setValues(x,y,z); 00166 if (i == 2) { 00167 vec[0] -= vec[1]; 00168 vec[1] -= vec[2]; 00169 vec[0].crossThis(vec[1]); 00170 vec[0].normalize(); 00171 00172 normals->getFieldPtr()->push_back ( vec[0] ); 00173 normals->getFieldPtr()->push_back ( vec[0] ); 00174 normals->getFieldPtr()->push_back ( vec[0] ); 00175 00176 i = 0; 00177 triCount++; 00178 } 00179 else 00180 i++; 00181 } 00182 } 00183 00184 endEditCP(points, FieldBits::AllFields); 00185 endEditCP(normals, FieldBits::AllFields); 00186 00187 if (triCount) 00188 { 00189 00190 index = GeoIndicesUI32::create(); 00191 geo->setIndices( index ); 00192 beginEditCP(index, FieldBits::AllFields); 00193 n = triCount * 3; 00194 for (i = 0; i < n; i++) 00195 index->getFieldPtr()->push_back( i ); 00196 endEditCP(index, FieldBits::AllFields); 00197 00198 00199 lens = GeoPLengthsUI32::create(); 00200 geo->setLengths( lens ); 00201 beginEditCP(lens, FieldBits::AllFields); 00202 lens->push_back( n ); 00203 endEditCP(lens, FieldBits::AllFields); 00204 00205 type = GeoPTypesUI8::create(); 00206 geo->setTypes( type ); 00207 beginEditCP(type, FieldBits::AllFields); 00208 type->push_back( GL_TRIANGLES ); 00209 endEditCP(type, FieldBits::AllFields); 00210 } 00211 00212 SimpleMaterialPtr mat = SimpleMaterial::create(); 00213 beginEditCP(mat, FieldBits::AllFields); 00214 mat->setDiffuse( Color3f( .8, .8, .8 ) ); 00215 mat->setSpecular( Color3f( 1, 1, 1 ) ); 00216 mat->setShininess( 20 ); 00217 endEditCP(mat, FieldBits::AllFields); 00218 00219 geo->setMaterial( mat ); 00220 endEditCP(geo, FieldBits::AllFields); 00221 } 00222 00223 if (triCount) 00224 SNOTICE << triCount << " triangle read " << std::endl; 00225 00226 return root; 00227 }
|
|
|
|
|
|
Definition at line 115 of file OSGSceneFileType.cpp. References osg::SceneFileType::_options. Referenced by osg::SceneFileHandler::setOptions(). 00116 { 00117 _options = options; 00118 }
|
|
|
Definition at line 138 of file OSGSceneFileType.cpp. References osg::SceneFileType::_suffixList. Referenced by osg::SceneFileHandler::addSceneFileType(), and osg::SceneFileHandler::subSceneFileType(). 00139 { 00140 return _suffixList; 00141 }
|
|
|
Definition at line 145 of file OSGSceneFileType.cpp. References osg::SceneFileType::_override. Referenced by osg::SceneFileHandler::addSceneFileType(), and osg::SceneFileHandler::FindOverride::operator()(). 00146 { 00147 return _override; 00148 }
|
|
|
Definition at line 152 of file OSGSceneFileType.cpp. References osg::SceneFileType::_overridePriority. Referenced by osg::SceneFileHandler::addSceneFileType(), and osg::SceneFileHandler::FindOverride::operator()(). 00153 { 00154 return _overridePriority; 00155 }
|
|
|
Definition at line 159 of file OSGSceneFileType.cpp. References osg::SceneFileType::_flags. Referenced by osg::SceneFileHandler::getSuffixList(), and osg::SceneFileHandler::print(). 00160 { 00161 return _flags; 00162 }
|
|
|
Definition at line 166 of file OSGSceneFileType.cpp. References osg::SceneFileType::_options. Referenced by osg::SceneFileHandler::getOptions(). 00167 { 00168 return _options.c_str(); 00169 }
|
|
|
Definition at line 181 of file OSGSceneFileType.cpp. References FWARNING, and osg::NullFC. Referenced by osg::SceneFileHandler::read().
|
|
||||||||||||||||
|
Reimplemented in osg::BINSceneFileType, osg::OSGSceneFileType, and osg::VRMLSceneFileType. Definition at line 188 of file OSGSceneFileType.cpp. References FWARNING. Referenced by osg::SceneFileHandler::write(). 00191 { 00192 FWARNING (("STREAM INTERFACE NOT IMPLEMENTED!\n")); 00193 return false; 00194 }
|
|
||||||||||||
|
Definition at line 197 of file OSGSceneFileType.cpp. References FWARNING. Referenced by osg::SceneFileHandler::write(). 00199 { 00200 FWARNING (("FILE INTERFACE NOT IMPLEMENTED!\n")); 00201 return false; 00202 }
|
|
|
Definition at line 121 of file OSGSceneFileType.cpp. References osg::SceneFileType::_suffixList, osg::SceneFileType::getName(), osg::LOG_DEBUG, osg::osgLog(), and osg::Log::stream(). 00122 { 00123 std::list<IDString>::iterator sI; 00124 00125 osgLog() << getName(); 00126 00127 if (_suffixList.empty()) 00128 osgLog() << "NONE"; 00129 else 00130 for (sI = _suffixList.begin(); sI != _suffixList.end(); sI++) 00131 osgLog().stream(OSG::LOG_DEBUG) << sI->str() << " "; 00132 00133 osgLog() << std::endl; 00134 }
|
|
|
Definition at line 77 of file OSGRAWSceneFileType.cpp. |
|
|
Referenced by the(). |
|
|
Definition at line 152 of file OSGSceneFileType.h. Referenced by osg::SceneFileType::print(), osg::SceneFileType::SceneFileType(), and osg::SceneFileType::suffixList(). |
|
|
Definition at line 154 of file OSGSceneFileType.h. Referenced by osg::SceneFileType::doOverride(). |
|
|
Definition at line 155 of file OSGSceneFileType.h. Referenced by osg::SceneFileType::getOverridePriority(). |
|
|
Definition at line 156 of file OSGSceneFileType.h. Referenced by osg::SceneFileType::getFlags(). |
|
|
Definition at line 158 of file OSGSceneFileType.h. Referenced by osg::SceneFileType::getOptions(), and osg::SceneFileType::setOptions(). |
1.4.3