VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGeom3dSpheresComponent.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 
12 #include <vrvCore/vrvCore.h>
16 
17 #include <vrvMath/DtVector4.h>
18 
19 #include <matrix/vlVector.h>
20 
21 #include <functional>
22 #include <map>
23 #include <vector>
24 
25 namespace makVrv
26 {
27  class DtGeom3dSpheresSystem;
28 
49  {
50  public:
51 
54 
58  friend class DtGeom3dSpheresSystem;
59 
62  enum class CategoryFlags : unsigned int
63  {
64  CategoryFlagsTracks = 0x0001, // used for track histories
65  CategoryFlagsRoutes = 0x0002, // used for routes
66  CategoryFlagsAll = 0xFFFF, // always active (default)
67  };
68 
70  typedef int SphereHandle;
71 
73  virtual ~DtGeom3dSpheresComponent();
74 
76  DtGeom3dSpheresComponent() = delete;
77 
80  const DtGeom3dSpheresComponent& other) = delete;
81 
84  const DtGeom3dSpheresComponent&& other) = delete;
85 
87  DtGeom3dSpheresComponent &operator=(
88  const DtGeom3dSpheresComponent& other) = delete;
89 
91  DtGeom3dSpheresComponent& operator=(
92  const DtGeom3dSpheresComponent&& other) = delete;
93 
94  protected:
95 
100 
101  public:
102 
104  virtual const DtModelSetId modelSetId() const;
105 
109  virtual void setCategoryFlags(DtGeom3dSpheresComponent::CategoryFlags flags);
110 
112  virtual const DtGeom3dSpheresComponent::CategoryFlags categoryFlags() const;
113 
115  virtual void clearSpheres();
116 
119  virtual void setCurrentColor(float r, float g, float b, float a);
120 
122  virtual const DtVector4<float> currentColor() const;
123 
130  virtual void setSphere(const DtVector& center, float radius, SphereHandle handle);
131 
135  virtual void removeSphere(SphereHandle handle);
136 
137  protected:
138 
141  virtual void submitSpheres(Dt3dSpheresStagingBuffer* buffer) const;
142 
147  void computeCullingSphere(DtVector3<double>& center, double& radiusSquared) const;
148 
149  protected:
150 
152  struct Sphere
153  {
155  };
156 
159  std::vector<DtGeom3dSpheresComponent::Sphere> mySpheres;
160  std::map<SphereHandle, DtGeom3dSpheresComponent::Sphere> myHandleSpheres;
161  float myColor[4];
166  };
167 
168 
169 
172  {
173  public:
176 
179 
182  const DtGeom3dSpheresComponentCreator& other) = delete;
183 
186  const DtGeom3dSpheresComponentCreator& other) = delete;
187 
188  public:
190  virtual DtGeom3dSpheresComponent* create(
191  DtGeom3dSpheresSystem& system, DtModelSetId modelSetId) const;
192 
196  static DtGeom3dSpheresComponentCreator& instance(DtDe& de);
197 
199  static const std::string& theClassName();
200  };
201 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtModelSetId myModelSetId
Definition: DtGeom3dSpheresComponent.h:158
A class which represents a component for a set of 3d spheres.
Definition: DtGeom3dSpheresComponent.h:48
DtVector3< double > myBoundsMax
Definition: DtGeom3dSpheresComponent.h:163
Dt3dSpheresStagingBuffer::Sphere mySphere
Definition: DtGeom3dSpheresComponent.h:154
DtGeom3dSpheresSystem & mySystem
Definition: DtGeom3dSpheresComponent.h:157
4 dimensional vector
A class which represents a buffer used for staging 3d spheres. &quot;staging&quot; means collecting, formatting, prepping data to be handed to another process (usually a rendering process). Most likely, this staged data will be passed to a gpu buffer at when needed.
Definition: Dt3dSpheresStagingBuffer.h:34
A class responsible for processing DtGeom3dSpheresComponent objects.
Definition: DtGeom3dSpheresSystem.h:62
std::vector< DtGeom3dSpheresComponent::Sphere > mySpheres
Definition: DtGeom3dSpheresComponent.h:159
CategoryFlags
Optional enumeration used to classify components for usage type. (see setCategoryFlags) ...
Definition: DtGeom3dSpheresComponent.h:62
creator for DtGeom3dSpheresComponent
Definition: DtGeom3dSpheresComponent.h:171
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
int SphereHandle
A handle type to identify individual spheres.
Definition: DtGeom3dSpheresComponent.h:70
Contains makVrv::Dt3dSpheresStagingBuffer class declaration.
bool myBoundsValid
Definition: DtGeom3dSpheresComponent.h:164
std::map< SphereHandle, DtGeom3dSpheresComponent::Sphere > myHandleSpheres
Definition: DtGeom3dSpheresComponent.h:160
DtGeom3dSpheresComponent::CategoryFlags myCategoryFlags
Definition: DtGeom3dSpheresComponent.h:165
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:72
DtVector3< double > myBoundsMin
Definition: DtGeom3dSpheresComponent.h:162
DtModelSetId
Definition: DtModelSetEnums.h:19
Contains the makVrv::DtGeom3dSpheresSystem class declaration.
A structure to hold data for 1 sphere.
Definition: DtGeom3dSpheresComponent.h:152
A structure to hold data for 1 sphere.
Definition: Dt3dSpheresStagingBuffer.h:41
Contains various enum classes relating to model sets.
Contains DLL export macros.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)