CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GeShell.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef _ODGESHELL_INCLUDED_
25#define _ODGESHELL_INCLUDED_
26
27#include "TD_PackPush.h"
28
29#include "Ge/GePoint3dArray.h"
30#include "Ge/GeVector3dArray.h"
31#include "DbStubPtrArray.h"
32#include "Int32Array.h"
33#include "UInt16Array.h"
34#include "UInt8Array.h"
35#include "CmEntityColorArray.h"
36#include "CmTransparencyArray.h"
37#include "GsMarkerArray.h"
38#include "Gi/GiGeometry.h"
39
54{
55protected:
57public:
58
66
71
79
84
89
94
99
104
109
114
119
124
129
134
139
144
149
154
159
164
170 void addVertex(const OdGePoint3d& vertex)
171 {
172 vertices.push_back(vertex);
173 }
174
178 void endFace()
179 {
180 if(m_nFaceStartIndex>=0)
181 {
184 }
185 }
186
192 void startFace(bool bHole = false)
193 {
194 ODA_ASSERT(m_nFaceStartIndex==-1); // endFace() wasn't called.
195 m_nFaceStartIndex = faces.size();
196 faces.push_back(bHole ? -1 : 1);
197 }
198
204 void addFaceVertex(int nVertexIndex)
205 {
206 edgeVisibilities.push_back(OdUInt8(nVertexIndex > 0));
207 faces.push_back(Od_abs(nVertexIndex)-1);
208 }
209
215 void draw(OdGiGeometry& geometry)
216 {
217 ODA_ASSERT(m_nFaceStartIndex<0 || faces[m_nFaceStartIndex]>2); // endFace() wasn't called.
218
219 OdGiEdgeData edgeData;
220 if (!edgeColors.isEmpty())
221 edgeData.setColors(edgeColors.getPtr());
222 if (!edgeTrueColors.isEmpty())
223 edgeData.setTrueColors(edgeTrueColors.getPtr());
224 if (!edgeLayers.isEmpty())
225 edgeData.setLayers((OdDbStub**)edgeLayers.getPtr());
226 if (!edgeLinetypes.isEmpty())
227 edgeData.setLinetypes((OdDbStub**)edgeLinetypes.getPtr());
228 if (!edgeSelectionMarkers.isEmpty())
229 edgeData.setSelectionMarkers(edgeSelectionMarkers.getPtr());
230 if (!edgeVisibilities.isEmpty())
231 edgeData.setVisibility(edgeVisibilities.getPtr());
232
233 OdGiFaceData faceData;
234 if (!faceColors.isEmpty())
235 faceData.setColors(faceColors.getPtr());
236 if (!faceTrueColors.isEmpty())
237 faceData.setTrueColors(faceTrueColors.getPtr());
238 if (!faceLayers.isEmpty())
239 faceData.setLayers((OdDbStub**)faceLayers.getPtr());
240 if (!faceNormals.isEmpty())
241 faceData.setNormals(faceNormals.getPtr());
242 if (!faceSelectionMarkers.isEmpty())
243 faceData.setSelectionMarkers(faceSelectionMarkers.getPtr());
244 if (!faceVisibilities.isEmpty())
245 faceData.setVisibility(faceVisibilities.getPtr());
246 if (!faceMaterials.isEmpty())
247 faceData.setMaterials((OdDbStub**)faceMaterials.getPtr());
248 if (!faceMappers.isEmpty())
249 faceData.setMappers(faceMappers.getPtr());
250 if (!faceTransparencies.isEmpty())
251 faceData.setTransparency(faceTransparencies.getPtr());
252
253 if (!textureCoords.isEmpty() || !vertexNormals.isEmpty())
254 {
255 OdGiVertexData pVertexData;
256 if (!textureCoords.isEmpty())
258 if (!vertexNormals.isEmpty())
259 pVertexData.setNormals(vertexNormals.getPtr());
260
261 geometry.shell(vertices.size(), vertices.getPtr(), faces.size(), faces.getPtr(), &edgeData, &faceData, &pVertexData);
262 }
263 else
264 geometry.shell(vertices.size(), vertices.getPtr(), faces.size(), faces.getPtr(), &edgeData, &faceData);
265 }
266};
267
268#include "TD_PackPop.h"
269
270
271#endif // _ODGESHELL_INCLUDED_
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > > OdGePoint3dArray
OdArray< OdCmEntityColor, OdMemoryAllocator< OdCmEntityColor > > OdCmEntityColorArray
OdArray< OdCmTransparency, OdMemoryAllocator< OdCmTransparency > > OdCmTransparencyArray
OdArray< OdDbStub *, OdMemoryAllocator< OdDbStub * > > OdDbStubPtrArray
#define ODA_ASSERT(exp)
Definition DebugStuff.h:57
OdArray< OdGeVector3d, OdMemoryAllocator< OdGeVector3d > > OdGeVector3dArray
OdArray< OdGsMarker, OdMemoryAllocator< OdGsMarker > > OdGsMarkerArray
OdArray< OdInt32, OdMemoryAllocator< OdInt32 > > OdInt32Array
Definition Int32Array.h:34
#define Od_abs
unsigned char OdUInt8
OdArray< OdUInt16, OdMemoryAllocator< OdUInt16 > > OdUInt16Array
Definition UInt16Array.h:34
OdArray< OdUInt8, OdMemoryAllocator< OdUInt8 > > OdUInt8Array
Definition UInt8Array.h:35
OdGeVector3dArray faceNormals
Definition GeShell.h:128
void draw(OdGiGeometry &geometry)
Definition GeShell.h:215
OdUInt8Array edgeVisibilities
Definition GeShell.h:108
void addVertex(const OdGePoint3d &vertex)
Definition GeShell.h:170
OdGeVector3dArray vertexNormals
Definition GeShell.h:163
OdDbStubPtrArray edgeLinetypes
Definition GeShell.h:98
OdInt32Array faces
Definition GeShell.h:78
int m_nFaceStartIndex
Definition GeShell.h:56
void endFace()
Definition GeShell.h:178
OdCmEntityColorArray edgeTrueColors
Definition GeShell.h:88
OdDbStubPtrArray edgeLayers
Definition GeShell.h:93
OdUInt16Array faceColors
Definition GeShell.h:113
OdDbStubPtrArray faceLayers
Definition GeShell.h:123
OdGeShell()
Definition GeShell.h:65
OdGsMarkerArray faceSelectionMarkers
Definition GeShell.h:133
OdUInt8Array faceVisibilities
Definition GeShell.h:138
OdArray< OdGiMapper > faceMappers
Definition GeShell.h:148
OdGsMarkerArray edgeSelectionMarkers
Definition GeShell.h:103
OdGePoint3dArray vertices
Definition GeShell.h:70
void startFace(bool bHole=false)
Definition GeShell.h:192
OdGePoint3dArray textureCoords
Definition GeShell.h:158
OdCmTransparencyArray faceTransparencies
Definition GeShell.h:153
OdDbStubPtrArray faceMaterials
Definition GeShell.h:143
OdUInt16Array edgeColors
Definition GeShell.h:83
void addFaceVertex(int nVertexIndex)
Definition GeShell.h:204
OdCmEntityColorArray faceTrueColors
Definition GeShell.h:118
void setTrueColors(const OdCmEntityColor *colors)
Definition GiGeometry.h:117
void setColors(const OdUInt16 *colors)
Definition GiGeometry.h:103
void setVisibility(const OdUInt8 *visibilities)
Definition GiGeometry.h:176
void setSelectionMarkers(const OdGsMarker *selectionMarkers)
Definition GiGeometry.h:154
void setLayers(OdDbStub **layerIds)
Definition GiGeometry.h:130
void setLinetypes(OdDbStub **linetypeIds)
Definition GiGeometry.h:143
void setLayers(OdDbStub **layerIds)
Definition GiGeometry.h:356
void setNormals(const OdGeVector3d *normals)
Definition GiGeometry.h:378
void setSelectionMarkers(const OdGsMarker *selectionMarkers)
Definition GiGeometry.h:367
void setMaterials(OdDbStub **materialIds)
Definition GiGeometry.h:411
void setColors(const OdUInt16 *colors)
Definition GiGeometry.h:328
void setTrueColors(const OdCmEntityColor *colors)
Definition GiGeometry.h:343
void setMappers(const OdGiMapper *mappers)
Definition GiGeometry.h:425
void setTransparency(const OdCmTransparency *transparencies)
Definition GiGeometry.h:440
void setVisibility(const OdUInt8 *visibilities)
Definition GiGeometry.h:398
virtual void shell(OdInt32 numVertices, const OdGePoint3d *vertexList, OdInt32 faceListSize, const OdInt32 *faceList, const OdGiEdgeData *pEdgeData=0, const OdGiFaceData *pFaceData=0, const OdGiVertexData *pVertexData=0)=0
void setMappingCoords(MapChannel channel, const OdGePoint3d *coords)
Definition GiGeometry.h:801
void setNormals(const OdGeVector3d *normals)
Definition GiGeometry.h:754