VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectModelSubGeometry.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 <vrvOsg/vrvOsg.h>
13 
16 
17 #define CPU_SIDE_COMPILATION 1
18 #include <../data/shaders/indirect/DrawElementsIndirectCommand.h>
19 
20 #include <osg/Matrix>
21 #include <osg/ref_ptr>
22 
23 #include <string>
24 #include <vector>
25 
26 namespace osg
27 {
28  class State;
29  class Geometry;
30 }
31 
32 namespace makVrv
33 {
34  class DtGlDeleteObjectManager;
35 
36  class DtGlBuffer;
37 
40  {
41  uint64_t mySizeVertices = 0;
43  uint64_t mySizeIndices = 0;
44  int myNumVertices = 0;
45  int myNumIndices = 0;
46  int myMaxCoords = 0;
47  };
48 
58  {
59  public:
62  struct VertexRange
63  {
64  int myStartVertex = -1;
65  int myEndVertex = -1;
66  };
67 
70  struct IndexRange
71  {
73  int myStartIndex = -1;
74  int myEndIndex = -1;
75  };
76 
77  public:
80 
82  DtIndirectModelSubGeometry(DtDe& de, const VertexRange& vertexRange, const IndexRange& indexRange);
83 
86 
89 
92 
94  DtIndirectModelSubGeometry() = delete;
95  public:
97  virtual void fillFrom(const osg::Geometry* srcGeometry, const osg::Matrix& matrix, const DtIndirectGeometryTextures& texturesForThisGeometry);
98 
100  virtual void copyData(
101  DtIndirectModelSubGeoProps& subGeoSizes
102  , std::vector<uint8_t>& vertexBuffer, uint64_t vertexBufferOffset
103  , std::vector<uint8_t>& indexBuffer, uint64_t indexBufferOffset);
104 
106  virtual int maxCoords(void) const;
107 
109  virtual void setName(const std::string& name);
110 
112  virtual const std::string& name(void) const;
113 
115  virtual const std::vector<DtIndirectBindlessVertexFormat>& vertices(void) const;
116 
118  virtual const std::vector<int>& indices(void) const;
119 
121  virtual const std::vector< std::vector<Vector2_32> >& textureCoordinates(void) const;
122 
123  protected:
124 
126 
127  std::string myName;
128 
129  std::vector<int> myIndices;
130 
131  std::vector<DtIndirectBindlessVertexFormat> myVertices;
132 
133  std::vector< std::vector<Vector2_32> > myTextureCoordinates;
134 
137 
140  };
141 }
Top level properties of a sub geo.
Definition: DtIndirectModelSubGeometry.h:39
A Vertex Range given to DtIndirectModelSubGeometry to facility targeting a specific subset of the geo...
Definition: DtIndirectModelSubGeometry.h:62
std::vector< int > myIndices
Definition: DtIndirectModelSubGeometry.h:129
uint64_t mySizeVertices
Definition: DtIndirectModelSubGeometry.h:41
virtual const std::vector< std::vector< Vector2_32 > > & textureCoordinates(void) const
access texture coordinates
int myStartVertex
Definition: DtIndirectModelSubGeometry.h:64
DtIndirectModelSubGeometry()=delete
not allowed
virtual const std::string & name(void) const
get the name (for debugging)
int myEndVertex
Definition: DtIndirectModelSubGeometry.h:65
virtual const std::vector< int > & indices(void) const
access indices
int myMaxCoords
Definition: DtIndirectModelSubGeometry.h:46
std::vector< std::vector< Vector2_32 > > myTextureCoordinates
Definition: DtIndirectModelSubGeometry.h:133
virtual void setName(const std::string &name)
set the name (for debugging)
VertexRange myVertexRange
The VertexRange that will be used for copy operations.
Definition: DtIndirectModelSubGeometry.h:136
DtIndirectModelSubGeometry & operator=(const DtIndirectModelSubGeometry &rhs)=delete
not allowed
virtual ~DtIndirectModelSubGeometry()
destructor
int myPrimitiveSetIndex
Definition: DtIndirectModelSubGeometry.h:72
uint64_t mySizeAdditionalCoordinates
Definition: DtIndirectModelSubGeometry.h:42
An Index Range given to DtIndirectModelSubGeometry to facility targeting a specific subset of the geo...
Definition: DtIndirectModelSubGeometry.h:70
int myNumVertices
Definition: DtIndirectModelSubGeometry.h:44
int myStartIndex
Definition: DtIndirectModelSubGeometry.h:73
virtual const std::vector< DtIndirectBindlessVertexFormat > & vertices(void) const
access vertices
This class represents the list of DtIndirectTexturePrototypes belonging to a particular sub-geometry...
Definition: DtIndirectGeometryTextures.h:38
int myEndIndex
Definition: DtIndirectModelSubGeometry.h:74
int myNumIndices
Definition: DtIndirectModelSubGeometry.h:45
DtDe & myDe
Definition: DtIndirectModelSubGeometry.h:125
std::vector< DtIndirectBindlessVertexFormat > myVertices
Definition: DtIndirectModelSubGeometry.h:131
virtual int maxCoords(void) const
The max texture coordinates unit/number of the texture coordinate sets.
geometry that is part of a model. refers to one index buffer and a vertex+color+normal+uv buffer corr...
Definition: DtIndirectModelSubGeometry.h:57
Contains DLL export macros.
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
IndexRange myIndexRange
The IndexRange that will be used for copy operations.
Definition: DtIndirectModelSubGeometry.h:139
Contains the DtIndirectGeometryTextures class declaration.
std::string myName
Definition: DtIndirectModelSubGeometry.h:127
virtual void fillFrom(const osg::Geometry *srcGeometry, const osg::Matrix &matrix, const DtIndirectGeometryTextures &texturesForThisGeometry)
copy src geometry into internal buffers
uint64_t mySizeIndices
Definition: DtIndirectModelSubGeometry.h:43
virtual void copyData(DtIndirectModelSubGeoProps &subGeoSizes, std::vector< uint8_t > &vertexBuffer, uint64_t vertexBufferOffset, std::vector< uint8_t > &indexBuffer, uint64_t indexBufferOffset)
copy data and sizes into the provided destination
Contains makVrv::DtIndirectBindlessVertexFormat class.

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)