Panda3D
 All Classes Functions Variables Enumerations
cLwoPolygons.h
1 // Filename: cLwoPolygons.h
2 // Created by: drose (25Apr01)
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 CLWOPOLYGONS_H
16 #define CLWOPOLYGONS_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoPolygons.h"
21 #include "eggGroup.h"
22 #include "pointerTo.h"
23 
24 #include "pmap.h"
25 
26 class LwoToEggConverter;
27 class CLwoPoints;
28 class CLwoSurface;
29 class LwoTags;
30 class LwoPolygonTags;
32 
33 ////////////////////////////////////////////////////////////////////
34 // Class : CLwoPolygons
35 // Description : This class is a wrapper around LwoPolygons and stores
36 // additional information useful during the
37 // conversion-to-egg process.
38 ////////////////////////////////////////////////////////////////////
39 class CLwoPolygons {
40 public:
41  INLINE CLwoPolygons(LwoToEggConverter *converter,
42  const LwoPolygons *polygons,
43  CLwoPoints *points);
44 
45  void add_ptags(const LwoPolygonTags *lwo_ptags, const LwoTags *tags);
46  void add_vmad(const LwoDiscontinuousVertexMap *lwo_vmad);
47 
48  CLwoSurface *get_surface(int polygon_index) const;
49  bool get_uv(const string &uv_name, int pi, int vi, LPoint2 &uv) const;
50 
51  void make_egg();
52  void connect_egg();
53 
54  LwoToEggConverter *_converter;
55  CPT(LwoPolygons) _polygons;
56  CLwoPoints *_points;
57  PT(EggGroup) _egg_group;
58 
59  const LwoTags *_tags;
61  PTags _ptags;
62 
63  const LwoPolygonTags *_surf_ptags;
64 
65  // There might be named maps associated with the polygons to bring a
66  // per-polygon mapping to the UV's.
68  VMad _txuv;
69 
70 private:
71  void make_faces();
72 };
73 
74 #include "cLwoPolygons.I"
75 
76 #endif
77 
78 
void add_vmad(const LwoDiscontinuousVertexMap *lwo_vmad)
Associates the indicated DiscontinousVertexMap with the polygons.
void add_ptags(const LwoPolygonTags *lwo_ptags, const LwoTags *tags)
Associates the indicated PolygonTags and Tags with the polygons in this chunk.
bool get_uv(const string &uv_name, int pi, int vi, LPoint2 &uv) const
Returns true if there is a UV of the indicated name associated with the given vertex of the indicated...
An association of polygons defined in the most recent LwoPolygons chunk to tag ids defined in the mos...
This class is a wrapper around LwoPolygons and stores additional information useful during the conver...
Definition: cLwoPolygons.h:39
CLwoSurface * get_surface(int polygon_index) const
Returns the surface associated with the given polygon, or NULL if no surface is associated.
An array of tag strings that will be referenced by later chunks.
Definition: lwoTags.h:35
void make_egg()
Creates the egg structures associated with this Lightwave object.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:36
This class is a wrapper around LwoSurface and stores additional information useful during the convers...
Definition: cLwoSurface.h:42
This class supervises the construction of an EggData structure from the data represented by the LwoHe...
This class is a wrapper around LwoPoints and stores additional information useful during the conversi...
Definition: cLwoPoints.h:36
This is a two-component point in space.
Definition: lpoint2.h:92
An array of polygons that will be referenced by later chunks.
Definition: lwoPolygons.h:32
void connect_egg()
Connects all the egg structures together.
A mapping of floating-point values per integer index.