Panda3D
 All Classes Functions Variables Enumerations
colladaPrimitive.h
1 // Filename: colladaPrimitive.h
2 // Created by: rdb (23May11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef COLLADAPRIMITIVE_H
16 #define COLLADAPRIMITIVE_H
17 
18 #include "config_collada.h"
19 #include "referenceCount.h"
20 #include "geomVertexData.h"
21 #include "geom.h"
22 #include "geomPrimitive.h"
23 
24 #include "colladaInput.h"
25 
26 class domP;
27 class domLines;
28 class domLinestrips;
29 class domPolygons;
30 class domPolylist;
31 class domTriangles;
32 class domTrifans;
33 class domTristrips;
34 
35 ////////////////////////////////////////////////////////////////////
36 // Class : ColladaPrimitive
37 // Description : Class that deals with COLLADA primitive structures,
38 // such as <triangles> and <polylist>.
39 ////////////////////////////////////////////////////////////////////
41 public:
42  static ColladaPrimitive *from_dom(domLines &lines);
43  static ColladaPrimitive *from_dom(domLinestrips &linestrips);
44  static ColladaPrimitive *from_dom(domPolygons &polygons);
45  static ColladaPrimitive *from_dom(domPolylist &polylist);
46  static ColladaPrimitive *from_dom(domTriangles &triangles);
47  static ColladaPrimitive *from_dom(domTrifans &trifans);
48  static ColladaPrimitive *from_dom(domTristrips &tristrips);
49 
50  unsigned int write_data(GeomVertexData *vdata, int start_row, domP &p);
51 
52  INLINE PT(Geom) get_geom() const;
53  INLINE const string &get_material() const;
54 
55 private:
57  void load_primitive(domP &p);
58  void load_primitives(daeTArray<daeSmartRef<domP> > &p_array);
59  INLINE void add_input(ColladaInput *input);
60 
62  Inputs _inputs;
63 
64  unsigned int _stride;
65  PT(Geom) _geom;
66  PT(GeomVertexData) _vdata;
67  PT(GeomPrimitive) _gprim;
68  string _material;
69 };
70 
71 #include "colladaPrimitive.I"
72 
73 #endif
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
Definition: geomPrimitive.h:63
Class that deals with COLLADA data sources.
Definition: colladaInput.h:45
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
Definition: geom.h:58
static ColladaPrimitive * from_dom(domLines &lines)
Returns the ColladaPrimitive object that represents the provided DOM input element.
A base class for all things that want to be reference-counted.
Class that deals with COLLADA primitive structures, such as &lt;triangles&gt; and &lt;polylist&gt;.
unsigned int write_data(GeomVertexData *vdata, int start_row, domP &p)
Writes the vertex data to the GeomVertexData.