/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// /************************************************************************/ /* World Geometry Sample classes */ /* As implemented, these methods do nothing but announce their */ /* invocation and return */ /************************************************************************/ #ifndef _WORLDGEOMSAMPLE_H_ #define _WORLDGEOMSAMPLE_H_ #include "OdaCommon.h" #include "CmColorBase.h" #include "Gi/GiGeometry.h" #include "Gi/GiCommonDraw.h" #include "StaticRxObject.h" #include "Gi/GiWorldGeometry.h" #include "Gi/GiWorldDraw.h" #include "Gi/GiViewportDraw.h" #include "Gi/GiViewportGeometry.h" #include "Gi/GiDummyGeometry.h" #include "Ge/GeMatrix3d.h" #define WC_CALLED(a) printf("%s\n", #a); OdGiSubEntityTraits_Stub g_Traits; template class OdGiCommonDraw_ : public T { public: OdGiRegenType regenType() const override { return eOdGiRegenTypeInvalid; } bool regenAbort() const override { return false; } OdGiSubEntityTraits& subEntityTraits() const override { return g_Traits; } bool isDragging() const override { return false; } OdGiContext* context() const override { return NULL; } OdUInt32 numberOfIsolines() const override { const int numIsol = 6; printf("numberOfIsolines = %d\n", numIsol); return numIsol; } double deviation(const OdGiDeviationType, const OdGePoint3d&) const override { return 0.; } }; #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable : 4100) #endif template class OdGiGeometry_ : public T { public: OdGeMatrix3d getModelToWorldTransform() const override { WC_CALLED(getModelToWorldTransform); return OdGeMatrix3d(); } OdGeMatrix3d getWorldToModelTransform() const override { WC_CALLED(getWorldToModelTransform); return OdGeMatrix3d(); } void pushModelTransform(const OdGeVector3d& vNormal) override { WC_CALLED(pushModelTransform); } void pushModelTransform(const OdGeMatrix3d& xMat) override { WC_CALLED(pushModelTransform); } void popModelTransform() override { WC_CALLED(popModelTransform); } void pline(const OdGiPolyline& , OdUInt32 , OdUInt32 ) override { WC_CALLED(pline); } // For drawing various primitives. // void circle(const OdGePoint3d& center, double radius, const OdGeVector3d& normal) override { WC_CALLED(circle); } void circle(const OdGePoint3d& p1, const OdGePoint3d& p2, const OdGePoint3d& p3) override { WC_CALLED(circle); } void circularArc(const OdGePoint3d& center, double radius, const OdGeVector3d& normal, const OdGeVector3d& startVector, double sweepAngle, OdGiArcType arcType = kOdGiArcSimple) override { WC_CALLED(circleArc); } void circularArc(const OdGePoint3d& start, const OdGePoint3d& point, const OdGePoint3d& end, OdGiArcType arcType = kOdGiArcSimple) override { WC_CALLED(circleArc); } void polyline(OdInt32 nbPoints, const OdGePoint3d* pVertexList, const OdGeVector3d* pNormal = NULL, OdGsMarker lBaseSubEntMarker = -1) override { WC_CALLED(polyline); } void polygon(OdInt32 nbPoints, const OdGePoint3d* pVertexList) override { WC_CALLED(polygon); } void mesh(OdInt32 rows, OdInt32 columns, const OdGePoint3d* pVertexList, const OdGiEdgeData* pEdgeData = NULL, const OdGiFaceData* pFaceData = NULL, const OdGiVertexData* pVertexData = NULL) override { WC_CALLED(mesh); } void shell(OdInt32 nbVertex, const OdGePoint3d* pVertexList, OdInt32 faceListSize, const OdInt32* pFaceList, const OdGiEdgeData* pEdgeData = NULL, const OdGiFaceData* pFaceData = NULL, const OdGiVertexData* pVertexData = NULL) override { WC_CALLED(shell); } void text(const OdGePoint3d& position, const OdGeVector3d& normal, const OdGeVector3d& direction, double height, double width, double oblique, const OdString& msg) override { WC_CALLED(text); } void text(const OdGePoint3d& position, const OdGeVector3d& normal, const OdGeVector3d& direction, const OdChar* msg, OdInt32 length, bool raw, const OdGiTextStyle* pTextStyle) override { WC_CALLED(text); } void ray(const OdGePoint3d& first, const OdGePoint3d& second) override { WC_CALLED(ray); } void nurbs(const OdGeNurbCurve3d& nurbs) override { WC_CALLED(nurbs); } void xline(const OdGePoint3d& p1, const OdGePoint3d& p2) override { WC_CALLED(xline); } void ellipArc(const OdGeEllipArc3d& arc, const OdGePoint3d* pEndPointsOverrides = 0, OdGiArcType arcType = kOdGiArcSimple) override { WC_CALLED(ellipArc); } void draw(const OdGiDrawable* pD) override { WC_CALLED(draw); } // If you push a clip boundary onto the stack you must pop it; // void pushClipBoundary(OdGiClipBoundary* pBoundary) override { WC_CALLED(pushClipBoundary); } void popClipBoundary() override { WC_CALLED(popClipBoundary); } void worldLine(const OdGePoint3d pnts[2]) override { WC_CALLED(worldLine); } void image( const OdGiImageBGRA32& img, const OdGePoint3d& origin, const OdGeVector3d& uVec, const OdGeVector3d& vVec, OdGiRasterImage::TransparencyMode trpMode = OdGiRasterImage::kTransparency8Bit) override { WC_CALLED(image); } void edge( const OdGiEdge2dArray& edges) override { WC_CALLED(edge); } }; class OdSampleWorldGeometry : public OdStaticRxObject > , public OdStaticRxObject > { ODRX_USING_HEAP_OPERATORS(OdStaticRxObject >); public: OdGiGeometry& rawGeometry() const override { return (OdGiGeometry&)*this; } OdGiWorldGeometry& geometry() const override { return (OdGiWorldGeometry&)*this; } void setExtents(const OdGePoint3d *pNewExtents) override { } }; class OdSampleViewportDraw : public OdStaticRxObject > , public OdStaticRxObject > , public OdStaticRxObject { ODRX_USING_HEAP_OPERATORS(OdStaticRxObject >); public: OdGiGeometry& rawGeometry() const override { return (OdGiGeometry&)*this; } OdGiViewportGeometry& geometry() const override { return (OdGiViewportGeometry&)*this; } OdGiViewport& viewport() const override { return (OdGiViewport&)*this; } OdUInt32 sequenceNumber() const override { return 0; } bool isValidId(const OdUInt32 acgiId) const override { return true; } OdDbStub* viewportObjectId() const override { return NULL; } void polylineEye(OdUInt32 nbPoints, const OdGePoint3d* pPoints) override {} void polygonEye(OdUInt32 nbPoints, const OdGePoint3d* pPoints) override {} void polylineDc(OdUInt32 nbPoints, const OdGePoint3d* pPoints) override {} void polygonDc(OdUInt32 nbPoints, const OdGePoint3d* pPoints) override {} void rasterImageDc( const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, const OdGiRasterImage* pImg, const OdGePoint2d* uvBoundary, OdUInt32 numBoundPts, bool transparency = false, double brightness = 50.0, double contrast = 50.0, double fade = 0.0) override {} void metafileDc( const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, const OdGiMetafile* pMetafile, bool bDcAligned = true, bool bAllowClipping = false) override {} void ownerDrawDc( const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, const OdGiSelfGdiDrawable* pDrawable, bool bDcAligned, bool bAllowClipping) override {} OdGeMatrix3d getModelToEyeTransform() const override { return OdGeMatrix3d(); } OdGeMatrix3d getEyeToModelTransform() const override { return OdGeMatrix3d(); } OdGeMatrix3d getWorldToEyeTransform() const override { return OdGeMatrix3d(); } OdGeMatrix3d getEyeToWorldTransform() const override { return OdGeMatrix3d(); } bool isPerspective() const override { return false; } bool doPerspective(OdGePoint3d& p) const override { return false; } bool doInversePerspective(OdGePoint3d&) const override { return false; } void getNumPixelsInUnitSquare(const OdGePoint3d& givenWorldpt, OdGePoint2d& pixelArea, bool includePerspective = true) const override { } OdGePoint3d getCameraLocation() const override { return OdGePoint3d(); } OdGePoint3d getCameraTarget() const override { return OdGePoint3d(0,0,1); } OdGeVector3d getCameraUpVector() const override { return OdGeVector3d(0,1,0); } OdGeVector3d viewDir() const override { return getCameraTarget() - getCameraLocation(); } OdUInt32 viewportId() const override { return 0; } OdInt16 acadWindowId() const override { return 0; } void getViewportDcCorners(OdGePoint2d& lower_left, OdGePoint2d& upper_right) const override { lower_left.set(0,0); upper_right.set(100,100); } bool getFrontAndBackClipValues(bool& clip_front, bool& clip_back, double& front, double& back) const override { clip_front = clip_back = false; return false; } double linetypeScaleMultiplier() const override { return 1.; } double linetypeGenerationCriteria() const override { return 1.; } bool layerVisible(OdDbStub* idLayer) const override { return true; } }; #ifdef _MSC_VER #pragma warning (pop) #endif #endif // _WORLDGEOMSAMPLE_H_