vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Ctrl_StringSculptures.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "Controller.h"
12 #include "Utils.h"
13 #include "Modes.h"
14 #include "Pattern.h"
15 #include "PatternGeode.h"
16 #include "ToolSelector.h"
17 #include "PhysXManager.h"
18 #include "ToolHook.h"
19 #include "DATool.h"
20 #include "ConstantDiameterGen.h"
21 #include "ToolBrush.h"
22 
23 using namespace vrecko;
24 
25 namespace APDYNAMICART
26 {
27 
29 {
30 public:
32  virtual void activateTool();
33  virtual void clear();
34  virtual void createMenuStructure( osg::ref_ptr<vreckoUtils::MenuBase> parentMenu ) const;
35  virtual void deactivateTool();
36  virtual void debugKeyPressed() {}
37  virtual void guiItemClicked( const char* itemID );
38  virtual void initialize( DAEnvironment* p_dae, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters = NULL );
39  virtual void load( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parametersNode, XERCES_CPP_NAMESPACE_QUALIFIER DOMNodeList* poaNodeList );
40  virtual void guiSliderChanged( const char* sliderID, float sliderPos );
41  virtual void save( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* Document, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *controllerNode );
42  virtual void switchTools( DAToolType newType );
43  virtual void setColour( osg::Vec4 newColour ) { _defaultColor = newColour; }
44  virtual void switchGUIVisibility() { err("Not implemented, yet.") };
45  virtual void turnOn();
46  virtual void turnOff( void );
47  virtual void update();
48 
50  virtual void notify( vreckoUtils::Observable* object, void* userData );
51 
55 
57  PoA* createPoA( const string& name );
58  void updateScene();
59 
60 protected:
62  void setSectorEditing(bool enable);
63  void setShowAxis(bool enable);
64  void checkPoADeleteRequest( HoopPtr hoop );
65  void checkHookDeleteRequest();
66  inline HoopPtr asHoop( PoA* poa);
67  void startSimulation();
68  void disableAutorotation();
69  void stopSimulation();
70  void updatePoAs();
71  void disableTools();
72  void setPatternColor( float newValue, unsigned int index );
73 
78 
82 
84  unsigned int _lineCount;
85  osg::ref_ptr<Hoop> _poa;
86  osg::Vec4 _defaultColor;
87  osg::Vec4 _patternColor;
88  std::vector<Vec3ArrayPtr> _finalArrays;
89  osg::ref_ptr<LinearInterpolator> _interpolator;
91  osg::ref_ptr<osg::Material> _patternMaterial;
92 
96 
98  bool _closedPattern; //NOTE: Just temporary
103 
106  osg::ref_ptr<ConstantDiameterGen> _ropeRadius;
107 };
108 
109 HoopPtr Ctrl_StringSculptures::asHoop( PoA* poa )
110 {
111  HoopPtr hoop = dynamic_cast<Hoop*>(poa);
112  if(hoop.valid())
113  return hoop;
114 
115  return NULL;
116 }
117 
118 }
119 // $Id$