CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GeShell.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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_
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.
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())
224 if (!edgeLayers.isEmpty())
225 edgeData.setLayers((OdDbStub**)edgeLayers.getPtr());
226 if (!edgeLinetypes.isEmpty())
227 edgeData.setLinetypes((OdDbStub**)edgeLinetypes.getPtr());
232
233 OdGiFaceData faceData;
234 if (!faceColors.isEmpty())
235 faceData.setColors(faceColors.getPtr());
236 if (!faceTrueColors.isEmpty())
238 if (!faceLayers.isEmpty())
239 faceData.setLayers((OdDbStub**)faceLayers.getPtr());
240 if (!faceNormals.isEmpty())
241 faceData.setNormals(faceNormals.getPtr());
246 if (!faceMaterials.isEmpty())
247 faceData.setMaterials((OdDbStub**)faceMaterials.getPtr());
248 if (!faceMappers.isEmpty())
249 faceData.setMappers(faceMappers.getPtr());
252
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_
#define ODA_ASSERT(exp)
Definition: DebugStuff.h:57
#define Od_abs
Definition: OdPlatform.h:141
unsigned char OdUInt8
const T * asArrayPtr() const
Definition: OdArray.h:1590
bool isEmpty() const
Definition: OdArray.h:1547
size_type size() const
Definition: OdArray.h:1247
void push_back(const T &value)
Definition: OdArray.h:1411
const T * getPtr() const
Definition: OdArray.h:1600
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:114
void setColors(const OdUInt16 *colors)
Definition: GiGeometry.h:100
void setVisibility(const OdUInt8 *visibilities)
Definition: GiGeometry.h:172
void setSelectionMarkers(const OdGsMarker *selectionMarkers)
Definition: GiGeometry.h:151
void setLayers(OdDbStub **layerIds)
Definition: GiGeometry.h:127
void setLinetypes(OdDbStub **linetypeIds)
Definition: GiGeometry.h:140
void setLayers(OdDbStub **layerIds)
Definition: GiGeometry.h:345
void setNormals(const OdGeVector3d *normals)
Definition: GiGeometry.h:367
void setSelectionMarkers(const OdGsMarker *selectionMarkers)
Definition: GiGeometry.h:356
void setMaterials(OdDbStub **materialIds)
Definition: GiGeometry.h:400
void setColors(const OdUInt16 *colors)
Definition: GiGeometry.h:317
void setTrueColors(const OdCmEntityColor *colors)
Definition: GiGeometry.h:332
void setMappers(const OdGiMapper *mappers)
Definition: GiGeometry.h:414
void setTransparency(const OdCmTransparency *transparencies)
Definition: GiGeometry.h:429
void setVisibility(const OdUInt8 *visibilities)
Definition: GiGeometry.h:387
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:711
void setNormals(const OdGeVector3d *normals)
Definition: GiGeometry.h:664