///////////////////////////////////////////////////////////////////////////////
// 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 _STEP_GICONTEXTFORSTEPDATABASE_H_
#define _STEP_GICONTEXTFORSTEPDATABASE_H_
#include "StepCore.h"
#include "daiStepFile.h"
#include "daiObjectId.h"
#include "GiDefaultContext.h"
#include "OdPlatform.h"
#include "StaticRxObject.h"
#include "Gs/Gs.h"
#include "StepBuildOptions.h"
class OdGiContextForStepDatabase;
class OdGiAuxDataForStep;
/** \details
A data type that represents a smart pointer to an OdGiContextForStepDatabase object.
*/
typedef OdSmartPtr OdGiContextForStepDatabasePtr;
/** \details
A class that implements working with a vectorization context for an STEP database.
*/
class STEPCORE_EXPORT OdGiContextForStepDatabase : public OdGiDefaultContext
{
//DOM-IGNORE-BEGIN
enum
{
kPlotGeneration = 1,
kUseGsModel = 2,
kOdGiZeroTextNormals = 4,
kDisableLayoutHelperLinkReactors = 8,
kTTFPolyDraw = 16,
kTrackDbDestroy = 32,
kManageContextualColors = 64,
kKeepPSLayoutHelperView = 128,
kErasePSLayoutHelperView = 256,
kLastFlag = kErasePSLayoutHelperView
};
OdUInt32 m_fflags;
OdStepFile* m_pDb;
OdGiAuxDataForStepPtr m_pCtxAuxData;
OdDAIObjectId m_pStepReprContextCur;
protected:
ODCOLORREF m_paletteBackground;
//DOM-IGNORE-END
public:
//DOM-IGNORE-BEGIN
ODRX_DECLARE_MEMBERS(OdGiContextForStepDatabase);
//DOM-IGNORE-END
/** \details
Creates a new Gi context instance for an STEP database with default parameters.
\remarks
By default, all flags are off and the palette background color is equal to black.
*/
OdGiContextForStepDatabase();
/** \details
Destroys the Gi context object.
*/
~OdGiContextForStepDatabase() {}
/** \details
Retrieves an STEP database that is currently associated with the Gi context object.
\returns A raw pointer to the database that is currently being vectorized.
Returns the STEP database that is currently being vectorized, represented as a pointer to an OdDbBaseDatabase object.
*/
virtual OdDbBaseDatabase* database() const;
/** \details
Retrieves the current value of the plot generation flag.
\returns true if the vectorization is intended for hard copy output; otherwise, the method returns false.
*/
virtual bool isPlotGeneration() const;
/** \details
Sets a new value of the plot generation flag.
\param plotGeneration [in] A new value of the plot generation flag value to be set.
\remarks
The plot generation flag is equal to true if the vectorization is intended for hard copy output; otherwise, the flag is equal to false.
*/
virtual void setPlotGeneration(bool plotGeneration);
/** \details
Sets a new palette background color.
\param paletteBackground [in] A new palette background color to be set.
*/
virtual void setPaletteBackground(ODCOLORREF paletteBackground);
/** \details
Opens for reading the specified drawable object that belongs to the database associated with the context object.
\param drawableId [in] An object's identifier of the drawable to be opened.
\returns A smart pointer to the drawable object.
*/
virtual OdGiDrawablePtr openDrawable(OdDbStub* drawableId);
/** \details
Retrieves the current palette background color of the context object.
\returns The current palette background color.
*/
virtual ODCOLORREF paletteBackground() const;
/** \details
Sets a new STEP database to be vectorized.
\param pStepFile [in] A smart pointer to an STEP file object.
*/
void setDatabase(OdStepFilePtr pStepFile);
/** \details
Retrieves the STEP database that is currently being vectorized.
\returns A raw pointer to the