Panda3D

Loading...
Searching...
No Matches
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;
30 class LwoDiscontinuousVertexMap;
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;
57 typedef pmap<IffId, const LwoPolygonTags *> PTags;
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.
64 typedef pmap<std::string, const LwoDiscontinuousVertexMap *> VMad;
65 VMad _txuv;
66
67 private:
68 void make_faces();
69};
70
71#include "cLwoPolygons.I"
72
73#endif
cLwoPolygons.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CLwoPoints
This class is a wrapper around LwoPoints and stores additional information useful during the conversi...
Definition cLwoPoints.h:33
CLwoPolygons::make_egg
void make_egg()
Creates the egg structures associated with this Lightwave object.
Definition cLwoPolygons.cxx:155
CLwoPolygons::get_uv
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...
Definition cLwoPolygons.cxx:128
CLwoPolygons::connect_egg
void connect_egg()
Connects all the egg structures together.
Definition cLwoPolygons.cxx:186
CLwoPolygons::add_vmad
void add_vmad(const LwoDiscontinuousVertexMap *lwo_vmad)
Associates the indicated DiscontinousVertexMap with the polygons.
Definition cLwoPolygons.cxx:62
CLwoPolygons::get_surface
CLwoSurface * get_surface(int polygon_index) const
Returns the surface associated with the given polygon, or NULL if no surface is associated.
Definition cLwoPolygons.cxx:86
CLwoPolygons::add_ptags
void add_ptags(const LwoPolygonTags *lwo_ptags, const LwoTags *tags)
Associates the indicated PolygonTags and Tags with the polygons in this chunk.
Definition cLwoPolygons.cxx:36
CLwoSurface
This class is a wrapper around LwoSurface and stores additional information useful during the convers...
Definition cLwoSurface.h:39
EggGroup
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition eggGroup.h:34
LwoDiscontinuousVertexMap
A mapping of floating-point values per integer index.
Definition lwoDiscontinuousVertexMap.h:28
LwoPolygonTags
An association of polygons defined in the most recent LwoPolygons chunk to tag ids defined in the mos...
Definition lwoPolygonTags.h:26
LwoPolygons
An array of polygons that will be referenced by later chunks.
Definition lwoPolygons.h:29
LwoTags
An array of tag strings that will be referenced by later chunks.
Definition lwoTags.h:31
LwoToEggConverter
This class supervises the construction of an EggData structure from the data represented by the LwoHe...
Definition lwoToEggConverter.h:38
eggGroup.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lwoPolygons.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pmap.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.