VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtScribeBoxModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
15 #include <osg/Group>
16 #include <osg/Geode>
17 
18 namespace makVrv
19 {
20  class DtDe;
21  class DtSceneObject;
22 
26  {
27  public:
29  DtScribeBoxModelInstance(DtDe& de, const std::string& uniqueName);
30 
33 
36  virtual void addToConnector(DtOsgSceneConnector* connector);
37 
40  virtual bool removeFromConnector(DtOsgSceneConnector* connector);
41 
43  virtual void drawBox();
44 
45  virtual void setColor(const osg::Vec4& color);
46  virtual void setLineWidth(double lineWidth);
47 
48  virtual void setParentSceneObject(const DtUniqueID& sceneObj);
49 
51  virtual void setVisible(bool isVisible) {}
52 
54  virtual void setOccluded(bool);
55 
57  virtual void setLineSmoothing(bool);
58 
60  virtual void slot_atcGlobalModelEnableChanged();
61 
62  protected:
63  void setNodeCullAndBin(osg::Node* n, bool isTransparent);
64  void updateScribeBoxSize();
65  void updateLineSmoothing();
66  void updateScribeBoxLineWidth();
67  void updateScribeBoxColor();
68  DtSceneObject* parentSceneObject();
69  osg::Geometry* scribeBox(const osg::Vec3& center, float lengthX,
70  float lengthY, float lengthZ);
71 
73  virtual void resetGeode();
74 
75  protected:
76 
77  osg::ref_ptr<osg::Group> myGroup;
78  osg::ref_ptr<osg::Geode> myShapeGeode;
79  osg::Vec4 myColor;
80  double myLineWidth;
81  std::string myUniqueName;
83  bool myOccluded;
85 
86  // When the class is destructed, the scene object may or may not
87  // exist. Using a separate connection variable makes it possible to
88  // 'disconnect' even if the scene object has been deleted.
89  boost::signalslib::connection myParentSceneObjectConnection;
90  boost::signalslib::connection myBoundingVolumeConnection;
91  };
92 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)