///////////////////////////////////////////////////////////////////////////////
// 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 _DAI_STEP_MODEL_CONTEXT_H
#define _DAI_STEP_MODEL_CONTEXT_H
#include "daiBuildOptions.h"
#include "daiDeviationParams.h"
#include "daiBrepParams.h"
#include "daiModel.h"
#include "SharedPtr.h"
#include "TD_PackPush.h"
/** \details
A class that implements working with an STEP model context.
*/
class DAI_EXPORT OdStepModelContext
{
public:
/** \details
Creates a new model context object with specified deviation parameters and color.
\param params [in] Deviation parameters.
\param color [in] Default model color value.
*/
OdStepModelContext(OdDeviationParams params = OdDeviationParams(), OdCmEntityColor color = OdCmEntityColor::kNone);
/** \details
Virtual destructor.
*/
virtual ~OdStepModelContext();
/** \details
Retrieves the current set of deviation parameters assigned with the model context.
\returns Returns an instance of the class that contains the current deviation parameters.
*/
OdDeviationParams getDeviationParams() const;
/** \details
Sets new deviation parameters for the model context.
\param params [in] Deviation parameters to be set.
*/
void setDeviationParams(OdDeviationParams params);
/** \details
Retrieves the current default model color.
\returns Returns an instance of the OdCmEntityColor object that contains the current default color for the model.
*/
OdCmEntityColor getDefaultEntityColor() const;
/** \details
Sets a new default model color.
\param color [in] An instance of the OdCmEntityColor object that represents the new default color.
*/
void setDefaultEntityColor(const OdCmEntityColor& color);
/** \details
Specifies identifiers of objects for which the compose operation will be skipped.
\param notComposeContext [in] Array of object Ids for which the compose operation will be skipped.
*/
void setSkipComposeIds(const OdDAIObjectIds& notComposeContext);
/** \details
Checks whether the specified identifier belongs to an object for which the compose operation will be skipped.
\param id [in] Identifier to check.
\returns true if the specified identifier belongs to an object for which the compose operation will be skipped; otherwise the method returns false.
*/
bool checkSkipComposeId(const OdDAIObjectId& id) const;
/** \details
Sets new array of hidden objects in model.
\param hiddenObjectsIds [in] An array of hidden objects .
*/
void setHiddenObjectsIds(const OdDAIObjectIds& hiddenObjectsIds);
/** \details
Adds new hidden object.
\param id [in] An id of new hidden object.
*/
void addHiddenObjectsId(const OdDAIObjectId& id);
/** \details
Checks if an object is marked as hidden.
\param id [in] An id of checked object.
\returns Returns True if an object is hidden; otherwise False.
*/
bool checkHiddenObject(const OdDAIObjectId& id) const;
/** \details
Removes hidden object from list.
\param id [in] An id of removed hidden object.
\returns Returns True if remove is successful; otherwise False.
*/
bool removeHiddenObjectId(const OdDAIObjectId& id);
void setInterruptCallback(OdDAI::InterruptCallback callbackFunction);
OdDAI::InterruptCallback getInterruptCallback();
/** \details
Retrieves the current set of brep parameters assigned with the model context.
\returns Returns an instance of the class that contains the current solid modeler parameters.
*/
const OdBrepParams& getBrepParams() const;
/** \details
Sets new brep parameters for the model context.
\param params [in] Solid modeler parameters to be set.
*/
void setBrepParams(OdBrepParams params);
//DOM-IGNORE-BEGIN
private:
OdDeviationParams m_deviationParams;
OdCmEntityColor m_defaultEntityColor;
OdDAIObjectIds m_selContexts;
OdDAI::InterruptCallback m_interrupt = nullptr;
OdDAIObjectIds m_skipComposeIds;
OdDAIObjectIds m_hiddenObjectsIds;
OdBrepParams m_brepParams;
//DOM-IGNORE-END
};
/** \details
A data type that represents a smart pointer to an object.
*/
typedef OdSharedPtr OdStepModelContextPtr;
#include "TD_PackPop.h"
#endif // _DAI_STEP_MODEL_CONTEXT_H