VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCubeModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtAttachableCuboidModelInstance.h,v $ $Revision: 1.0 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
15 #include <osg/Geode>
16 #include <osg/MatrixTransform>
17 #include <osg/Drawable>
18 #include <osg/Material>
19 
20 namespace makVrv
21 {
25  {
26  public:
27 
30 
32  virtual ~DtCubeModelInstance();
33 
35  virtual void setDimensions(float x, float y, float z);
36 
38  void dimensions( float& length, float& width, float& height );
39 
41  virtual void setColor(float r,float g,float b,float a);
42 
44  const osg::Vec4& color() const;
45 
47  virtual void setLightingEnabled( bool enabled );
48 
51  virtual bool realize(DtModelDefinition& definition);
52 
54  virtual void setVisible(bool isVisible) {}
55 
57  virtual void setContributesToBound(bool trueOrFalse);
58 
59  protected:
60 
62  virtual void updateColors();
63 
65  virtual void updateTransform();
66 
68  void createBlendedGeodes();
69 
71  void createOpaqueGeode();
72 
74  void createSingleSidedBlendedGeode();
75 
76  protected:
77 
79  float myLength; // x dimension
80  float myWidth; // y dimension
81  float myHeight;
82  osg::Vec4 myColor;
83 
97 
99  };
100 
104  {
105  public:
106 
108  static void registerCreator(DtDe& de);
109 
111  virtual ~DtCubeModelInstanceCreator ();
112 
114  virtual DtModelInstance* create(DtDe& de);
115 
116  protected:
117 
119  };
120 }
The base class for all model instances.
Definition: DtModelInstance.h:39
osg::ref_ptr< osg::Drawable > myCubeDrawable
Definition: DtCubeModelInstance.h:84
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::MatrixTransform > myTransform
My tranform.
Definition: DtCubeModelInstance.h:94
osg::ref_ptr< osg::Material > myMaterial
My Material.
Definition: DtCubeModelInstance.h:96
bool mySingleSided
Definition: DtCubeModelInstance.h:98
float myHeight
Definition: DtCubeModelInstance.h:81
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:33
Contains makVrv::DtOsgModelInstance class.
Model instance to draw a cuboid.
Definition: DtCubeModelInstance.h:24
The base class for simple OSG based model instances.
Definition: DtOsgModelInstance.h:72
virtual void setVisible(bool isVisible)
no-op
Definition: DtCubeModelInstance.h:54
The polymorphic creator for the DtModelInstance.
Definition: DtModelInstance.h:148
osg::ref_ptr< osg::Geode > myBlendedGeode
Geode to draw the geometry when single-sided blending is required.
Definition: DtCubeModelInstance.h:88
osg::Vec4 myColor
Definition: DtCubeModelInstance.h:82
float myLength
The current parameter set.
Definition: DtCubeModelInstance.h:79
osg::ref_ptr< osg::Geode > myGeode
Geode to draw the geometry when no blending is required.
Definition: DtCubeModelInstance.h:86
float myWidth
Definition: DtCubeModelInstance.h:80
A Creator for the makVrv::DtAttachableCuboidModelInstance class.
Definition: DtCubeModelInstance.h:103
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osg::ref_ptr< osg::Geode > myFrontGeode
Geode to draw the geometry with backface culling.
Definition: DtCubeModelInstance.h:90
osg::ref_ptr< osg::Geode > myBackGeode
Geode to draw the geometry with frontface culling.
Definition: DtCubeModelInstance.h:92

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)