/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #ifndef ODEXGSOPENGLVECTORIZEDEVICE #define ODEXGSOPENGLVECTORIZEDEVICE #include "TD_PackPush.h" #include "GsOpenGLVectorizer.h" #include "CommonOpenGLProps.h" // Comment it, if you want compile with non-streamed version of vectorizer #include "GsOpenGLStreamVectorizer.h" #ifdef OD_OGL_ENABLEMETASTREAM OD_OPENGL_DEFINE_COMMON_PROPS(ExGsOpenGLVectorizeDeviceBase, OdGsOpenGLStreamVectorizeDevice, OdCommonDeviceProps); typedef OdGsOpenGLStreamVectorizeView ExGsOpenGLVectorizeViewBase; #else OD_OPENGL_DEFINE_COMMON_PROPS(ExGsOpenGLVectorizeDeviceBase, OdGsOpenGLVectorizeDevice, OdCommonDeviceProps); typedef OdGsOpenGLVectorizeView ExGsOpenGLVectorizeViewBase; #endif /** \details This class implements OpenGL Vectorizer Device objects for Mac platform. Library: Source code provided. */ class ExGsOpenGLVectorizeDevice : public ExGsOpenGLVectorizeDeviceBase { protected: bool m_bContextCreated; friend class ExGsOpenGLVectorizeView; public: /** \details Returns the state of the ContextCreated property. \returns true if the property is enabled, false otherwise. \remarks This property is set to false before the first device update and set to true after the first device update. Changing this property doesn't modify any behavior. */ bool isContextCreated() const { return m_bContextCreated; } /** \details Sets the state of the ContextCreated property. \param bVal [in] State of the property. \remarks This property is set to false before the first device update and set to true after the first device update. Changing this property doesn't modify any behavior. */ void setContextCreated(bool bVal) { m_bContextCreated = bVal; } protected: ODRX_USING_HEAP_OPERATORS(ExGsOpenGLVectorizeDeviceBase); ODRX_DECLARE_DYNAMIC_PROPERTY_MAP(ExGsOpenGLVectorizeDevice); ExGsOpenGLVectorizeDevice(); virtual ~ExGsOpenGLVectorizeDevice(); void update(OdGsDCRect* pUpdatedRect); void updateScreen(); /** \details Creates a context for this Device object. */ virtual void createContext(); virtual void deleteContext(); #ifdef OD_OGL_ENABLEMETASTREAM bool supportMultithreading() const { return gsMultithreadEnabled(); } #endif bool checkExtensionFuncSupport(OpenGLExtension extIdx) const; void *getExtensionFuncPtrFromListInt(const char *pFuncName) const; }; /** \details This class implements OpenGL Vectorizer View objects for Mac platform. Library: Source code provided. */ class ExGsOpenGLVectorizeView : public ExGsOpenGLVectorizeViewBase { /** \details Returns a device that owns this view. \returns Pointer a device that contains this view. */ ExGsOpenGLVectorizeDevice* device() { return static_cast(OdGsOpenGLVectorizeView::device()); } bool m_bSelecting; public: /** \details Default constructor for the ExGsOpenGLVectorizeView class. */ ExGsOpenGLVectorizeView(); /** \details Invokes the specified OdGsSelectionReactor object for the specified selection area (or point) in this view. \param points [in] Array of points. \param numPoints [in] Number of points. \param pReactor [in] Pointer to the reactor. \param mode [in] Selection mode. */ void select(const OdGePoint2d* points, int numPoints, OdGsSelectionReactor* pReactor, OdGsView::SelectionMode mode); /** \details Processes polyline data. \param numPoints [in] Number of points in the polyline. \param vertexList [in] Array of vertices that make up the polyline. \sa */ void polylineOut(OdInt32 numPoints, const OdGePoint3d* vertexList); /** \details Processes mesh data. \param numRows [in] Number of rows. \param numColumns [in] Number of columns. \param vertexList [in] Array of vertices. \param pEdgeData [in] Pointer to additional edge data. \param pFaceData [in] Pointer to additional face data. \param pVertexData [in] Pointer to additional vertex data. \sa */ void meshProc(OdInt32 numRows, OdInt32 numColumns, const OdGePoint3d* vertexList, const OdGiEdgeData* pEdgeData = 0, const OdGiFaceData* pFaceData = 0, const OdGiVertexData* pVertexData = 0); /** \details Processes shell data. \param numVertices [in] Number of vertices. \param vertexList [in] Array of vertices. \param faceListSize [in] Number of entries in faceList. \param faceList [in] Array of numbers that define the faces. \param pEdgeData [in] Pointer to additional edge data. \param pFaceData [in] Pointer to additional face data. \param pVertexData [in] Pointer to additional vertex data. \sa */ void shellProc(OdInt32 numVertices, const OdGePoint3d* vertexList, OdInt32 faceListSize, const OdInt32* faceList, const OdGiEdgeData* pEdgeData = 0, const OdGiFaceData* pFaceData = 0, const OdGiVertexData* pVertexData = 0); /** \details Processes raster images data. \param origin [in] Lower-left corner. \param u [in] Image width vector. \param v [in] Image height vector. \param pImage [in] Pointer to the RasterImage object. \param uvBoundary [in] Array of image boundary points (may not be null). \param numBoundPts [in] Number of boundary points. \param transparency [in] True if and only if image transparency is on. \param brightness [in] Image brightness [0.0 .. 100.0]. \param contrast [in] Image contrast [0.0 .. 100.0]. \param fade [in] Image fade value [0.0 .. 100.0]. \sa */ void rasterImageProc(const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, const OdGiRasterImage* pImage, const OdGePoint2d* uvBoundary, OdUInt32 numBoundPts, bool transparency = false, double brightness = 50.0, double contrast = 50.0, double fade = 0.0); /** \details Processes metafile data. \param origin [in] Metafile origin. \param u [in] Metafile width vector. \param v [in] Metafile height vector. \param pMetafile [in] Pointer to the metafile object. \param dcAligned [in] Reserved. \param allowClipping [in] Reserved. */ void metafileProc(const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, const OdGiMetafile* pMetafile, bool dcAligned = true, bool allowClipping = false); //void ownerDrawDc( // const OdGePoint3d& origin, // const OdGeVector3d& u, // const OdGeVector3d& v, // const OdGiSelfGdiDrawable* pDrawable, // bool dcAligned = true, // bool allowClipping = false); }; #include "TD_PackPop.h" #endif // ODEXGSOPENGLVECTORIZEDEVICE