VR-Forces Developer's Guide
 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 
15 
16 #include <osg/Geode>
17 #include <osg/MatrixTransform>
18 #include <osg/Drawable>
19 #include <osg/Material>
20 
21 namespace makVrv
22 {
24 
26 
27  template <>
28  inline const char* modelInstanceClassName<DtCubeModelInstance>(void) { return "DtCubeModelInstance"; }
29 
30  template <>
31  inline const char* modelInstanceObjectClass<DtCubeModelInstance>(void) { return "DtModel"; }
32 
36  {
37  public:
38 
41 
43  virtual ~DtCubeModelInstance();
44 
45  private:
46 
49 
52 
54  DtCubeModelInstance &operator=(const DtCubeModelInstance&);
55 
56  public:
57 
59  virtual void setDimensions(float x, float y, float z);
60 
62  void dimensions( float& length, float& width, float& height );
63 
65  virtual void setColor(float r,float g,float b,float a);
66 
68  const osg::Vec4& color() const;
69 
71  virtual void setLightingEnabled( bool enabled );
72 
76  virtual bool realize(const DtModelDefinition& definition);
77 
79  virtual void setVisible(bool isVisible) {}
80 
82  virtual void setContributesToBound(bool trueOrFalse);
83 
84  protected:
85 
87  virtual void updateColors();
88 
90  virtual void updateTransform();
91 
93  void createBlendedGeodes();
94 
96  void createOpaqueGeode();
97 
99  void createSingleSidedBlendedGeode();
100 
101  protected:
102 
104  float myLength; // x dimension
105  float myWidth; // y dimension
106  float myHeight;
107  osg::Vec4 myColor;
108 
122 
124  };
125 }
osg::ref_ptr< osg::Drawable > myCubeDrawable
Definition: DtCubeModelInstance.h:109
double length(const dvec3 &theVec)
Definition: DtVecUtils.h:20
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::MatrixTransform > myTransform
My tranform.
Definition: DtCubeModelInstance.h:119
Definition: DtTemplatedModelInstanceCreator.h:32
osg::ref_ptr< osg::Material > myMaterial
My Material.
Definition: DtCubeModelInstance.h:121
bool mySingleSided
Definition: DtCubeModelInstance.h:123
float myHeight
Definition: DtCubeModelInstance.h:106
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:44
Contains makVrv::DtOsgModelInstance class.
Model instance to draw a cuboid.
Definition: DtCubeModelInstance.h:35
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
virtual void setVisible(bool isVisible)
no-op
Definition: DtCubeModelInstance.h:79
osg::ref_ptr< osg::Geode > myBlendedGeode
Geode to draw the geometry when single-sided blending is required.
Definition: DtCubeModelInstance.h:113
Contains the DtTemplatedModelInstanceCreator class declaration.
osg::Vec4 myColor
Definition: DtCubeModelInstance.h:107
const char * modelInstanceClassName< DtCubeModelInstance >(void)
Definition: DtCubeModelInstance.h:28
float myLength
The current parameter set.
Definition: DtCubeModelInstance.h:104
DtTemplatedModelInstanceCreator< DtCubeModelInstance > DtCubeModelInstanceCreator
Definition: DtCubeModelInstance.h:23
osg::ref_ptr< osg::Geode > myGeode
Geode to draw the geometry when no blending is required.
Definition: DtCubeModelInstance.h:111
float myWidth
Definition: DtCubeModelInstance.h:105
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
osg::ref_ptr< osg::Geode > myFrontGeode
Geode to draw the geometry with backface culling.
Definition: DtCubeModelInstance.h:115
const char * modelInstanceObjectClass< DtCubeModelInstance >(void)
Definition: DtCubeModelInstance.h:31
osg::ref_ptr< osg::Geode > myBackGeode
Geode to draw the geometry with frontface culling.
Definition: DtCubeModelInstance.h:117

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)