00001 #ifndef IGUANA_GL_MODELS_IG_2D_MODEL_H
00002 # define IGUANA_GL_MODELS_IG_2D_MODEL_H
00003
00004
00005
00006 # include "Iguana/GLModels/interface/config.h"
00007 # include "Iguana/GLModels/interface/Ig3DBaseModel.h"
00008 # include <string>
00009 # include <set>
00010
00011
00012
00013
00014
00015 class Ig2DRep;
00016 class SoTransform;
00017 class SoIndexedFaceSet;
00018 class SoNode;
00019 class SbVec3f;
00020 class SoShapeHints;
00021 class SoGroup;
00022
00023
00024
00025
00026
00027 class IGUANA_GL_MODELS_API Ig2DModel : public Ig3DBaseModel
00028 {
00029 public:
00030 Ig2DModel (IgState *state, Ig3DBaseModel *sourceModel);
00031
00032 Ig3DBaseModel * sourceModel (void) const;
00033 void setCutTransform (SbVec3f axis, float angle);
00034 SoNode * cutTransform (void) const;
00035 SoNode * cutPlane (void) const;
00036 void setCutPlanePosition (float x, float y);
00037 void setCutPlaneSize (float w, float h);
00038
00039 Ig2DRep * getLayer (const std::string &name);
00040 bool isToBeCut (std::string);
00041
00042 private:
00043 Ig2DRep * createFull (Ig2DRep *parent, const std::string &str);
00044 Ig2DRep * fullMatch (Ig3DBaseRep *from, const std::string &str);
00045 std::string closestMatchName (const std::string &str);
00046 std::string getFirst (const std::string &str);
00047 std::string getLast (const std::string &str);
00048 std::string removeFirst (const std::string &str);
00049 std::string removeLast (const std::string &str);
00050
00051 Ig3DBaseModel *m_sourceModel;
00052 SoIndexedFaceSet *m_plane;
00053 SoTransform *m_objectTransform;
00054 SoGroup *m_cutGroup;
00055 SoShapeHints *m_cutHints;
00056 SoTransform *m_cutScale;
00057 SoTransform *m_cutPosition;
00058
00059
00060 typedef std::set<std::string> NotCutTwigSet;
00061 NotCutTwigSet m_cutConf;
00062 };
00063
00064
00065
00066
00067 #endif // IGUANA_GL_MODELS_IG_2D_MODEL_H