CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FxGeomUtils.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2025 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19#include "DDKERNEL.h"
20
21#include <IdArrays.h>
22
23#include <DbSubentId.h>
24#include <DbEntity.h>
25#include <DbCurve.h>
26#include <DbPolyline.h>
27#include <Db3dSolid.h>
28
29#include <Ge/GePoint3d.h>
30#include <Ge/GePoint2d.h>
31#include <Ge/GeVector3d.h>
32#include <Ge/GeMatrix3d.h>
33#include <Ge/GePoint3dArray.h>
34
35#include "FxPragmaPush.h"
36
37class CFxView;
38class CFxGsNode;
39
41{
42public:
49 CFxView* pView,
50 CFxGsNode* p3dSolidGsNode,
51 const OdGePoint3d& ptPickPoint,
52 OdArray<OdGsMarker>& aMarkers) const = 0;
61 OdDb3dSolidPtr pSolid,
62 const OdDbFullSubentPath & face,
63 OdGeVector3d & normal) const = 0;
78 const OdGePoint3d& pt,
79 OdDbEntityPtr pObj,
80 const OdDbFullSubentPath& face,
81 OdGePoint3d& closest,
82 OdGeVector3d& Utangent,
83 OdGeVector3d& Vtangent) const = 0;
84
100 OdDbEntityPtr pObj,
101 double tol,
102 const OdGePoint3d& base,
103 const OdGeVector3d& viewDir,
104 OdArray<OdDbSubentId>& subEntIds,
105 OdGeDoubleArray& parameters) const = 0;
106
122 OdDbEntityPtr pObj,
123 double tol,
124 const OdGePoint3d& base,
125 const OdGeVector3d& viewDir,
126 OdArray<OdDbSubentId>& subEntIds,
127 OdGePoint3d& pickPoint) const = 0;
128
129 // Description:
146 std::vector<OdDbEntityPtr> pObjs,
147 double tol,
148 const OdGePoint3d& base,
149 const OdGeVector3d& viewDir,
150 int& index,
151 OdArray<OdDbSubentId>& subEntIds,
152 OdGeDoubleArray& parameters) const = 0;
153 // Description:
170 std::vector<OdDbEntityPtr> pObjs,
171 double tol,
172 const OdGePoint3d & base,
173 const OdGeVector3d& viewDir,
174 int & index,
175 OdArray<OdDbSubentId> & subEntIds,
176 OdGePoint3d & pickPoint) const = 0;
177
193
195 std::vector<OdDbEntityPtr> pObjs,
196 double tol,
197 const OdGePoint3d& base,
198 const OdGeVector3d& viewDir,
199 int& index, // index of corresponding solid
200 OdArray<OdDbSubentId>& subEntIds,
201 OdArray<OdGePoint3d>& pickPoints ) const = 0;
202
203 // Description:
218
220 std::vector<OdDbEntityPtr> pObjs,
221 double tol,
222 const OdGePoint3d & base,
223 const OdGeVector3d& viewDir,
224 int& index, // index of corresponding solid
225 OdArray<OdDbSubentId>& subEntIds,
226 OdGeDoubleArray& parameters ) const = 0;
227
239 virtual bool SelectEdgeOnFace(CFxView* pView,
240 CFxGsNode* p3dSolidGsNode,
241 const OdGePoint3d& ptPickPoint,
242 const OdGsMarker& faceId,
243 OdGsMarker& edgeId) const = 0;
244
254 virtual bool GetEdgesFromFace(
255 OdDb3dSolidPtr p3dSolid,
256 const OdDbFullSubentPath & face,
257 OdDbFullSubentPathArray & edgePaths) const = 0;
258
265
269 static OdGePoint3dArray GetImageBoundary(const OdGeMatrix3d& mPixelToModel, const OdGePoint2d* uvBoundary, OdUInt32 numBoundPts);
270
274 static OdGeMatrix3d GetPixelToModelTransform(const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, double ySize);
275
276
280 static OdDbEntityPtr GetPolySegment(const OdDbEntityPtr pPoly, const OdGePoint3d& pickPoint);
281 static bool GetSegmentAtPoint(OdDbCurvePtr pPLine, const OdGePoint3d pointOnPLine, OdGeCircArc3d &circ, OdGeLineSeg3d &line, bool& isArc, bool& isLine);
283};
284
285namespace FxHLR
286{
288 {
289 public:
290 virtual ~IHLData();
291 virtual OdDbObjectPtr GetEntity() const = 0;
292 virtual int GetFlags() const = 0;
293
295 {
296 virtual ~IHLOriginal();
297 virtual OdDbObjectPtr GetEntity() const = 0;
298 virtual OdDbSubentId GetSubEntity() const = 0;
299 };
302 };
304
306 const OdGePoint3d& eye_pos, const OdGePoint3d& target_pos, bool bPersepcitveProjection, OdArray<IHLDataPtr>& output);
307}
308
309#include "FxPragmaPop.h"
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > > OdGePoint3dArray
#define DDKERNEL_API
Definition DDKERNEL.h:32
OdSmartPtr< OdDb3dSolid > OdDb3dSolidPtr
Definition Db3dSolid.h:59
OdSmartPtr< OdDbCurve > OdDbCurvePtr
Definition DbCurve.h:44
OdArray< OdDbEntityPtr > OdDbEntityPtrArray
Definition DbEntity.h:56
OdSmartPtr< OdDbEntity > OdDbEntityPtr
Definition DbEntity.h:51
OdSmartPtr< OdDbObject > OdDbObjectPtr
Definition DbObject.h:1750
OdSmartPtr< OdDbPolyline > OdDbPolylinePtr
Definition DbPolyline.h:611
OdArray< OdDbFullSubentPath > OdDbFullSubentPathArray
Definition DbSubentId.h:169
tol
OdArray< double, OdMemoryAllocator< double > > OdGeDoubleArray
OdArray< OdDbObjectId, OdClrMemAllocator< OdDbObjectId > > OdDbObjectIdArray
Definition IdArrays.h:53
ptrdiff_t OdGsMarker
unsigned int OdUInt32
OdResult
Definition OdResult.h:29
static OdGeMatrix3d GetPixelToModelTransform(const OdGePoint3d &origin, const OdGeVector3d &u, const OdGeVector3d &v, double ySize)
virtual bool GetNormalOfPlanarFace(OdDb3dSolidPtr pSolid, const OdDbFullSubentPath &face, OdGeVector3d &normal) const =0
virtual bool GetClosestPointInFace(const OdGePoint3d &pt, OdDbEntityPtr pObj, const OdDbFullSubentPath &face, OdGePoint3d &closest, OdGeVector3d &Utangent, OdGeVector3d &Vtangent) const =0
virtual bool shootRayToGetMultipleSubEntities(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
virtual bool shootRayAgainstObject(OdDbEntityPtr pObj, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, OdArray< OdDbSubentId > &subEntIds, OdGePoint3d &pickPoint) const =0
virtual bool shootRayAgainstObject(OdDbEntityPtr pObj, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
virtual void SelectSubentsByPoint(CFxView *pView, CFxGsNode *p3dSolidGsNode, const OdGePoint3d &ptPickPoint, OdArray< OdGsMarker > &aMarkers) const =0
static OdDbEntityPtr GetPolySegment(const OdDbEntityPtr pPoly, const OdGePoint3d &pickPoint)
virtual bool GetEdgesFromFace(OdDb3dSolidPtr p3dSolid, const OdDbFullSubentPath &face, OdDbFullSubentPathArray &edgePaths) const =0
static OdDbPolylinePtr ConvertToStdPolyline(OdDbCurvePtr pCurve)
virtual bool shootRayToGetMultipleSubEntities(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdArray< OdGePoint3d > &pickPoints) const =0
virtual bool SelectEdgeOnFace(CFxView *pView, CFxGsNode *p3dSolidGsNode, const OdGePoint3d &ptPickPoint, const OdGsMarker &faceId, OdGsMarker &edgeId) const =0
virtual bool shootRayAgainstArrayObjects(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGePoint3d &pickPoint) const =0
static OdGeMatrix3d GetTransform(const OdDbFullSubentPath &path)
static OdGeMatrix3d GetTransform(const OdDbObjectIdArray &idArray)
static bool GetSegmentAtPoint(OdDbCurvePtr pPLine, const OdGePoint3d pointOnPLine, OdGeCircArc3d &circ, OdGeLineSeg3d &line, bool &isArc, bool &isLine)
virtual bool shootRayAgainstArrayObjects(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
static OdGePoint3dArray GetImageBoundary(const OdGeMatrix3d &mPixelToModel, const OdGePoint2d *uvBoundary, OdUInt32 numBoundPts)
virtual int GetFlags() const =0
OdSharedPtr< IHLOriginal > IHLOriginalPtr
virtual ~IHLData()
virtual OdDbObjectPtr GetEntity() const =0
virtual const OdArray< IHLOriginalPtr > & GetOriginalEntities() const =0
GLuint index
Definition gles2_ext.h:265
const GLfloat * v
Definition gles2_ext.h:315
OdSharedPtr< IHLData > IHLDataPtr
DDKERNEL_API OdResult FlatShotHL(const OdDbEntityPtrArray &input, const OdGePoint3d &eye_pos, const OdGePoint3d &target_pos, bool bPersepcitveProjection, OdArray< IHLDataPtr > &output)
virtual OdDbSubentId GetSubEntity() const =0
virtual OdDbObjectPtr GetEntity() const =0