diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-07 19:04:25 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-07 19:04:25 +0400 |
commit | 9a1217e55980f9b0a501fbe03ab2ea559638392d (patch) | |
tree | 28b4c5bcf547d2d9f63d7d687ff6f43064cc0dc5 /source/blender/freestyle/intern/scene_graph/Rep.h | |
parent | 1baf09110b2c3bd4a6eea128b61ca9a0017f81dd (diff) |
soc-2008-mxcurioni: first version of lib3ds code. It does NOT work yet and has to be debugged. It can be activate in app_blender/api.cpp by replacing the FRS_scene_3ds_export call in FRS_prepare, by FRS_load_mesh.
All of the reference to the original Material class were renamed to FrsMaterial to resolve a name collision with Blender. To keep the window context necessary to draw the strokes after RE_Database_FromScene has been called, the display_clear function is used.
Diffstat (limited to 'source/blender/freestyle/intern/scene_graph/Rep.h')
-rwxr-xr-x | source/blender/freestyle/intern/scene_graph/Rep.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/source/blender/freestyle/intern/scene_graph/Rep.h b/source/blender/freestyle/intern/scene_graph/Rep.h index ee5f2942abf..6b213b01ba7 100755 --- a/source/blender/freestyle/intern/scene_graph/Rep.h +++ b/source/blender/freestyle/intern/scene_graph/Rep.h @@ -36,7 +36,7 @@ # include "../geometry/BBox.h" # include "../geometry/Geom.h" # include "../system/Precision.h" -# include "Material.h" +# include "FrsMaterial.h" # include "../system/Id.h" using namespace Geometry; @@ -45,33 +45,33 @@ class LIB_SCENE_GRAPH_EXPORT Rep : public BaseObject { public: - inline Rep() : BaseObject() {_Id = 0; _Material=0;} + inline Rep() : BaseObject() {_Id = 0; _FrsMaterial=0;} inline Rep(const Rep& iBrother) : BaseObject() { _Id = iBrother._Id; - if(0 == iBrother._Material) - _Material = 0; + if(0 == iBrother._FrsMaterial) + _FrsMaterial = 0; else - _Material = new Material(*(iBrother._Material)); + _FrsMaterial = new FrsMaterial(*(iBrother._FrsMaterial)); _BBox = iBrother.bbox(); } inline void swap(Rep& ioOther){ std::swap(_BBox,ioOther._BBox); std::swap(_Id, ioOther._Id); - std::swap(_Material,ioOther._Material); + std::swap(_FrsMaterial,ioOther._FrsMaterial); } Rep& operator=(const Rep& iBrother){ if(&iBrother != this){ _Id = iBrother._Id; - if(0 == iBrother._Material) - _Material = 0; + if(0 == iBrother._FrsMaterial) + _FrsMaterial = 0; else{ - if(_Material == 0){ - _Material = new Material(*iBrother._Material); + if(_FrsMaterial == 0){ + _FrsMaterial = new FrsMaterial(*iBrother._FrsMaterial); }else{ - (*_Material)=(*(iBrother._Material)); + (*_FrsMaterial)=(*(iBrother._FrsMaterial)); } _BBox = iBrother.bbox(); } @@ -80,10 +80,10 @@ public: } virtual ~Rep() { - if(0 != _Material) + if(0 != _FrsMaterial) { - delete _Material; - _Material = 0; + delete _FrsMaterial; + _FrsMaterial = 0; } } @@ -92,8 +92,8 @@ public: * inherited classes */ virtual void accept(SceneVisitor& v) { - if(_Material) - v.visitMaterial(*_Material); + if(_FrsMaterial) + v.visitFrsMaterial(*_FrsMaterial); v.visitRep(*this); } @@ -108,20 +108,20 @@ public: /*! Returns the rep bounding box */ virtual const BBox<Vec3r>& bbox() const {return _BBox;} inline Id getId() const {return _Id;} - inline const Material * material() const {return _Material;} + inline const FrsMaterial * frs_material() const {return _FrsMaterial;} /*! Sets the Rep bounding box */ virtual void setBBox(const BBox<Vec3r>& iBox) {_BBox = iBox;} inline void setId(const Id& id) {_Id = id;} - inline void setMaterial(const Material& iMaterial) + inline void setFrsMaterial(const FrsMaterial& iMaterial) { - _Material = new Material(iMaterial); + _FrsMaterial = new FrsMaterial(iMaterial); } private: BBox<Vec3r> _BBox; Id _Id; - Material *_Material; + FrsMaterial *_FrsMaterial; }; #endif // REP_H |