Panda3D
cLwoPolygons.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file cLwoPolygons.h
10  * @author drose
11  * @date 2001-04-25
12  */
13 
14 #ifndef CLWOPOLYGONS_H
15 #define CLWOPOLYGONS_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "lwoPolygons.h"
20 #include "eggGroup.h"
21 #include "pointerTo.h"
22 
23 #include "pmap.h"
24 
25 class LwoToEggConverter;
26 class CLwoPoints;
27 class CLwoSurface;
28 class LwoTags;
29 class LwoPolygonTags;
31 
32 /**
33  * This class is a wrapper around LwoPolygons and stores additional
34  * information useful during the conversion-to-egg process.
35  */
36 class CLwoPolygons {
37 public:
38  INLINE CLwoPolygons(LwoToEggConverter *converter,
39  const LwoPolygons *polygons,
40  CLwoPoints *points);
41 
42  void add_ptags(const LwoPolygonTags *lwo_ptags, const LwoTags *tags);
43  void add_vmad(const LwoDiscontinuousVertexMap *lwo_vmad);
44 
45  CLwoSurface *get_surface(int polygon_index) const;
46  bool get_uv(const std::string &uv_name, int pi, int vi, LPoint2 &uv) const;
47 
48  void make_egg();
49  void connect_egg();
50 
51  LwoToEggConverter *_converter;
52  CPT(LwoPolygons) _polygons;
53  CLwoPoints *_points;
54  PT(EggGroup) _egg_group;
55 
56  const LwoTags *_tags;
58  PTags _ptags;
59 
60  const LwoPolygonTags *_surf_ptags;
61 
62  // There might be named maps associated with the polygons to bring a per-
63  // polygon mapping to the UV's.
65  VMad _txuv;
66 
67 private:
68  void make_faces();
69 };
70 
71 #include "cLwoPolygons.I"
72 
73 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool get_uv(const std::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:36
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An array of tag strings that will be referenced by later chunks.
Definition: lwoTags.h:31
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:34
This class is a wrapper around LwoSurface and stores additional information useful during the convers...
Definition: cLwoSurface.h:39
CLwoSurface * get_surface(int polygon_index) const
Returns the surface associated with the given polygon, or NULL if no surface is associated.
This class supervises the construction of an EggData structure from the data represented by the LwoHe...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is a wrapper around LwoPoints and stores additional information useful during the conversi...
Definition: cLwoPoints.h:33
An array of polygons that will be referenced by later chunks.
Definition: lwoPolygons.h:29
void connect_egg()
Connects all the egg structures together.
A mapping of floating-point values per integer index.