CFx SDK Documentation  2023 SP0
DbRasterImage.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 
25 
26 
27 #ifndef __IMGENT_H
28 #define __IMGENT_H
30 #include "TD_PackPush.h"
31 
32 #include "Ge/GePoint2dArray.h"
33 
34 class OdRasterImageImpl;
35 
36 #include "DbImage.h"
37 #include "DbRasterImageDef.h"
38 
48 {
49 public:
51 
53 
55  {
56  kInvalid, // Invalid
57  kRect, // Rectangular
58  kPoly // Polygonal
59  };
60 
62  {
63  kShow = 1, // Show
64  kShowUnAligned = 2, // Show unaligned
65  kClip = 4, // Clip
66  kTransparent = 8 // Transparent
67  };
68 
73  virtual void setImageDefId(
74  OdDbObjectId imageDefId);
75 
79  virtual OdDbObjectId imageDefId() const;
80 
89  virtual void setReactorId(
90  OdDbObjectId reactorId);
91 
99  virtual OdDbObjectId reactorId() const;
100 
106  virtual void setClipBoundary(
107  const OdGePoint2dArray& clipPoints);
108 
114  virtual const OdGePoint2dArray& clipBoundary() const;
115 
119  bool isClipped() const;
120 
132  OdGePoint3dArray& vertices) const;
133 
141 
146 
151 
157  OdInt8 brightness );
158 
164  virtual OdInt8 brightness() const;
165 
171  OdInt8 contrast );
172 
178  virtual OdInt8 contrast() const;
179 
185  virtual OdResult setFade(
186  OdInt8 fade );
187 
193  virtual OdInt8 fade() const;
194 
212  virtual void setDisplayOpt(
213  ImageDisplayOpt optionIndex,
214  bool value);
215 
222  virtual bool isSetDisplayOpt(
223  ImageDisplayOpt option) const;
224 
232  bool getCachedValue = false) const;
233 
243  virtual OdGeVector2d scale() const;
244 
260  virtual bool setOrientation(
261  const OdGePoint3d& origin,
262  const OdGeVector3d& u,
263  const OdGeVector3d& v);
264 
275  virtual void getOrientation(
276  OdGePoint3d& origin,
277  OdGeVector3d& u,
278  OdGeVector3d& v) const;
279 
285  virtual void setClipInverted(bool val);
286 
290  virtual bool isClipInverted() const;
291 
292 
305  OdDbDwgFiler* pFiler) ODRX_OVERRIDE;
306 
307  virtual void dwgOutFields(
308  OdDbDwgFiler* pFiler) const ODRX_OVERRIDE;
309 
311  OdDbDxfFiler* pFiler) ODRX_OVERRIDE;
312 
313  virtual void dxfOutFields(
314  OdDbDxfFiler* pFiler) const ODRX_OVERRIDE;
315 
316  virtual void subClose() ODRX_OVERRIDE;
317 
318  /*
319  virtual void subSwapIdWith(OdDbObjectId otherId, bool swapXdata = false, bool swapExtDict = false);
320  */
321 
322  virtual bool subWorldDraw(
323  OdGiWorldDraw* pWd) const ODRX_OVERRIDE;
324 
325  virtual void subViewportDraw(
326  OdGiViewportDraw* pVd) const ODRX_OVERRIDE;
327 
328  virtual OdResult subGetGeomExtents(
329  OdGeExtents3d& extents) const ODRX_OVERRIDE;
330 
331  virtual OdResult subGetClassID(
332  void* pClsid) const ODRX_OVERRIDE;
333 
334  virtual OdResult subTransformBy(
335  const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
336 
337  virtual OdResult subExplode(
338  OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
339 
340  virtual OdDbObjectPtr subDeepClone(
341  OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary) const ODRX_OVERRIDE;
342 
343  /*
344  virtual void getOsnapPoints( OdDb::OsnapMode osnapMode,
345  OdGsMarker gsSelectionMark, const OdGePoint3d& pickPoint,
346  const OdGePoint3d& lastPoint, const OdGeMatrix3d& viewXform,
347  OdGePoint3dArray& snapPoints, OdDbIntArray& geomIds) const;
348 
349  virtual void getGripPoints(OdGePoint3dArray& gripPoints,
350  OdDbIntArray& osnapModes, OdDbIntArray& geomIds) const;
351 
352  virtual void moveGripPointsAt(const OdDbIntArray& indices, const OdGeVector3d& offset);
353 
354  virtual void getStretchPoints(OdGePoint3dArray& stretchPoints) const;
355 
356  virtual void moveStretchPointsAt(const OdDbIntArray& indices, const OdGeVector3d& offset);
357 
358  virtual void transformBy(const OdGeMatrix3d& xform);
359  virtual void getTransformedCopy(const OdGeMatrix3d& xform, OdDbEntity** ent) const;
360  virtual OdResult explode(OdRxObjectPtrArray& entitySet) const; //Replace OdRxObjectPtrArray
361  virtual bool subGetGeomExtents(OdGeExtents3d& extents) const;
362 
363  virtual void getSubentPathsAtGsMarker(OdDb::SubentType type,
364  OdGsMarker gsMark, const OdGePoint3d& pickPoint,
365  const OdGeMatrix3d& viewXform, int& numPaths,
366  OdDbFullSubentPath*& subentPaths, int numInserts = 0,
367  OdDbObjectId* entAndInsertStack = 0) const;
368 
369  virtual void getGsMarkersAtSubentPath(
370  const OdDbFullSubentPath& subPath,
371  OdGsMarkerArray& gsMarkers) const;
372 
373  virtual OdDbEntityPtr subentPtr(const OdDbFullSubentPath& id) const;
374  virtual void saveAs(OdGiWorldDraw* mode, OdDb::EntSaveAsType st);
375  virtual void intersectWith(const OdDbEntity* ent,
376  OdDb::Intersect intType, OdGePoint3dArray& points,
377  OdGsMarker thisGsMarker = 0, OdGsMarker otherGsMarker = 0) const;
378 
379  virtual void intersectWith(const OdDbEntity* ent,
380  OdDb::Intersect intType, const OdGePlane& projPlane,
381  OdGePoint3dArray& points, OdGsMarker thisGsMarker = 0,
382  OdGsMarker otherGsMarker = 0) const;
383  */
384 };
385 
393 inline void pixelToModel(
394  const OdGeMatrix3d& xfm,
395  const OdGePoint2d& pixelPoint,
396  OdGePoint3d& modelPoint)
397 {
398  modelPoint.set(pixelPoint.x, pixelPoint.y, 0);
399  modelPoint.transformBy(xfm);
400 }
401 
410 inline void modelToPixel(
411  const OdGeMatrix3d& xfm,
412  const OdGePoint3d& modelPoint,
413  OdGePoint2d& pixelPoint)
414 {
415  OdGePoint3d modelPt = modelPoint;
416  modelPt.transformBy(xfm);
417  pixelPoint.set(modelPt.x, modelPt.y);
418 }
419 
420 inline void modelToPixel(
421  const OdGeVector3d& viewDir,
422  const OdGeMatrix3d& xfm,
423  const OdGePlane& plane,
424  const OdGePoint3d& modelPoint,
425  OdGePoint2d& pixelPoint)
426 {
427  OdGePoint3d ptOnPlane = modelPoint.project(plane, viewDir);
428  ptOnPlane.transformBy(xfm);
429  pixelPoint.set(ptOnPlane.x, ptOnPlane.y);
430 }
431 
433  const OdGeVector3d& u,
434  const OdGeVector3d& v,
435  double ySize)
436 {
437  OdGeVector3d vOffset(0.5 * u + (ySize - 0.5) * v);
438  OdGeMatrix3d x;
439  x.setCoordSystem( origin + vOffset, u, -v, u.crossProduct(v));
440  return x;
441 }
442 
447 
448 #include "TD_PackPop.h"
449 
450 #endif // __IMGENT_H
451 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbRasterImage > OdDbRasterImagePtr
OdGeMatrix3d pixelToModelTransform(const OdGePoint3d &origin, const OdGeVector3d &u, const OdGeVector3d &v, double ySize)
void pixelToModel(const OdGeMatrix3d &xfm, const OdGePoint2d &pixelPoint, OdGePoint3d &modelPoint)
void modelToPixel(const OdGeMatrix3d &xfm, const OdGePoint3d &modelPoint, OdGePoint2d &pixelPoint)
signed char OdInt8
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
virtual void getOrientation(OdGePoint3d &origin, OdGeVector3d &u, OdGeVector3d &v) const
virtual void setImageDefId(OdDbObjectId imageDefId)
virtual bool isClipInverted() const
virtual OdResult getVertices(OdGePoint3dArray &vertices) const
virtual OdGeVector2d scale() const
virtual const OdGePoint2dArray & clipBoundary() const
virtual OdResult setBrightness(OdInt8 brightness)
virtual void setClipBoundary(const OdGePoint2dArray &clipPoints)
virtual OdDbObjectId reactorId() const
virtual void setClipInverted(bool val)
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const ODRX_OVERRIDE
virtual OdGeMatrix3d getPixelToModelTransform() const
virtual OdResult setFade(OdInt8 fade)
ClipBoundaryType clipBoundaryType() const
virtual OdDbObjectId imageDefId() const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const ODRX_OVERRIDE
virtual void setDisplayOpt(ImageDisplayOpt optionIndex, bool value)
virtual OdGeVector2d imageSize(bool getCachedValue=false) const
virtual void setClipBoundaryToWholeImage()
virtual bool setOrientation(const OdGePoint3d &origin, const OdGeVector3d &u, const OdGeVector3d &v)
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler) ODRX_OVERRIDE
virtual OdInt8 fade() const
virtual void setReactorId(OdDbObjectId reactorId)
virtual void subClose() ODRX_OVERRIDE
virtual OdResult setContrast(OdInt8 contrast)
virtual OdInt8 brightness() const
virtual OdInt8 contrast() const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler) ODRX_OVERRIDE
ODDB_DECLARE_MEMBERS(OdDbRasterImage)
bool isClipped() const
virtual bool isSetDisplayOpt(ImageDisplayOpt option) const
OdGePoint2d & set(double xx, double yy)
Definition: GePoint2d.h:290
OdGePoint3d & transformBy(const OdGeMatrix3d &xfm)
OdGePoint3d project(const OdGePlane &plane, const OdGeVector3d &vect) const
double y
Definition: GePoint3d.h:368
double x
Definition: GePoint3d.h:367
OdGeVector3d crossProduct(const OdGeVector3d &vect) const
virtual OdRxObject * x(const OdRxClass *pClass) const
const GLfloat * v
Definition: gles2_ext.h:315
GLfloat x
Definition: gles2_ext.h:314
GLsizei const GLfloat * value
Definition: gles2_ext.h:302