Skip to content

Commit 0bdafe4

Browse files
committed
Fix various issues in bam2egg:
* No longer inserts an extra root group for the ModelRoot * Support depth test, offset and cull bin attributes * Preserve non-GeomNodes under Character * Render attributes are applied on group level if possible
1 parent 08ea4bf commit 0bdafe4

20 files changed

+261
-158
lines changed

panda/src/egg/eggLine.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
TypeHandle EggLine::_type_handle;
1919

20-
2120
/**
2221
*
2322
*/
@@ -26,6 +25,14 @@ EggLine::
2625
clear();
2726
}
2827

28+
/**
29+
* Makes a copy of this object.
30+
*/
31+
EggLine *EggLine::
32+
make_copy() const {
33+
return new EggLine(*this);
34+
}
35+
2936
/**
3037
* Writes the point to the indicated output stream in Egg format.
3138
*/

panda/src/egg/eggLine.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class EXPCL_PANDAEGG EggLine : public EggCompositePrimitive {
2929
INLINE EggLine &operator = (const EggLine &copy);
3030
virtual ~EggLine();
3131

32+
virtual EggLine *make_copy() const OVERRIDE;
33+
3234
virtual void write(ostream &out, int indent_level) const;
3335

3436
INLINE bool has_thick() const;

panda/src/egg/eggNurbsCurve.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717

1818
TypeHandle EggNurbsCurve::_type_handle;
1919

20+
/**
21+
* Makes a copy of this object.
22+
*/
23+
EggNurbsCurve *EggNurbsCurve::
24+
make_copy() const {
25+
return new EggNurbsCurve(*this);
26+
}
27+
2028
/**
2129
* Prepares a new curve definition with the indicated order and number of
2230
* knots. This also implies a particular number of vertices as well (the

panda/src/egg/eggNurbsCurve.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class EXPCL_PANDAEGG EggNurbsCurve : public EggCurve {
2929
INLINE EggNurbsCurve(const EggNurbsCurve &copy);
3030
INLINE EggNurbsCurve &operator = (const EggNurbsCurve &copy);
3131

32+
virtual EggNurbsCurve *make_copy() const OVERRIDE;
33+
3234
void setup(int order, int num_knots);
3335

3436
INLINE void set_order(int order);

panda/src/egg/eggNurbsSurface.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717

1818
TypeHandle EggNurbsSurface::_type_handle;
1919

20+
/**
21+
* Makes a copy of this object.
22+
*/
23+
EggNurbsSurface *EggNurbsSurface::
24+
make_copy() const {
25+
return new EggNurbsSurface(*this);
26+
}
27+
2028
/**
2129
* Prepares a new surface definition with the indicated order and number of
2230
* knots in each dimension. This also implies a particular number of vertices

panda/src/egg/eggNurbsSurface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class EXPCL_PANDAEGG EggNurbsSurface : public EggSurface {
3636
INLINE EggNurbsSurface(const EggNurbsSurface &copy);
3737
INLINE EggNurbsSurface &operator = (const EggNurbsSurface &copy);
3838

39+
virtual EggNurbsSurface *make_copy() const OVERRIDE;
40+
3941
void setup(int u_order, int v_order,
4042
int num_u_knots, int num_v_knots);
4143

panda/src/egg/eggPatch.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121

2222
TypeHandle EggPatch::_type_handle;
2323

24+
/**
25+
* Makes a copy of this object.
26+
*/
27+
EggPatch *EggPatch::
28+
make_copy() const {
29+
return new EggPatch(*this);
30+
}
2431

2532
/**
2633
* Writes the patch to the indicated output stream in Egg format.

panda/src/egg/eggPatch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class EXPCL_PANDAEGG EggPatch : public EggPrimitive {
2828
INLINE EggPatch(const EggPatch &copy);
2929
INLINE EggPatch &operator = (const EggPatch &copy);
3030

31+
virtual EggPatch *make_copy() const OVERRIDE;
32+
3133
virtual void write(ostream &out, int indent_level) const;
3234

3335
public:

panda/src/egg/eggPoint.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717

1818
TypeHandle EggPoint::_type_handle;
1919

20+
/**
21+
* Makes a copy of this object.
22+
*/
23+
EggPoint *EggPoint::
24+
make_copy() const {
25+
return new EggPoint(*this);
26+
}
2027

2128
/**
2229
* Cleans up modeling errors in whatever context this makes sense. For

panda/src/egg/eggPoint.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class EXPCL_PANDAEGG EggPoint : public EggPrimitive {
2828
INLINE EggPoint(const EggPoint &copy);
2929
INLINE EggPoint &operator = (const EggPoint &copy);
3030

31+
virtual EggPoint *make_copy() const OVERRIDE;
32+
3133
INLINE bool has_thick() const;
3234
INLINE double get_thick() const;
3335
INLINE void set_thick(double thick);

0 commit comments

Comments
 (0)