Panda3D
|
00001 // Filename: colladaInput.h 00002 // Created by: rdb (23May11) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef COLLADAINPUT_H 00016 #define COLLADAINPUT_H 00017 00018 #include "config_collada.h" 00019 #include "referenceCount.h" 00020 #include "pvector.h" 00021 #include "pta_LVecBase4.h" 00022 #include "internalName.h" 00023 #include "geomEnums.h" 00024 00025 class GeomPrimitive; 00026 class GeomVertexArrayFormat; 00027 class GeomVertexData; 00028 00029 #if PANDA_COLLADA_VERSION < 15 00030 #define domInput_local domInputLocal 00031 #define domInput_localRef domInputLocalRef 00032 #define domInput_local_offset domInputLocalOffset 00033 #define domInput_local_offsetRef domInputLocalOffsetRef 00034 #endif 00035 00036 class domInput_local; 00037 class domInput_local_offset; 00038 class domP; 00039 class domSource; 00040 00041 //////////////////////////////////////////////////////////////////// 00042 // Class : ColladaInput 00043 // Description : Class that deals with COLLADA data sources. 00044 //////////////////////////////////////////////////////////////////// 00045 class ColladaInput : public ReferenceCount { 00046 public: 00047 static ColladaInput *from_dom(domInput_local_offset &input); 00048 static ColladaInput *from_dom(domInput_local &input); 00049 00050 int make_vertex_columns(GeomVertexArrayFormat *fmt) const; 00051 void write_data(GeomVertexData *vdata, int start_row, domP &p, unsigned int stride) const; 00052 00053 INLINE bool is_vertex_source() const; 00054 INLINE unsigned int get_offset() const; 00055 00056 private: 00057 ColladaInput(const string &semantic); 00058 ColladaInput(const string &semantic, unsigned int set); 00059 bool read_data(domSource &source); 00060 void write_data(GeomVertexData *vdata, int start_row, domP &p, unsigned int stride, unsigned int offset) const; 00061 00062 typedef pvector<PT(ColladaInput)> Inputs; 00063 Inputs _vertex_inputs; 00064 PTA_LVecBase4f _data; 00065 00066 // Only filled in when appropriate. 00067 PT(InternalName) _column_name; 00068 GeomEnums::Contents _column_contents; 00069 00070 unsigned int _num_bound_params; 00071 unsigned int _offset; 00072 string _semantic; 00073 bool _have_set; 00074 unsigned int _set; 00075 }; 00076 00077 #include "colladaInput.I" 00078 00079 #endif