/////////////////////////////////////////////////////////////////////////////// // 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 _DbBlockVisibilityParameter_h_Included_ #define _DbBlockVisibilityParameter_h_Included_ #include "DbBlock1PtParameter.h" /** \details Block parameter allowing to hide parts of the block */ class DYNBLOCKS_EXPORT OdDbBlockVisibilityParameter : public OdDbBlock1PtParameter { public: ODDB_EVAL_DECLARE_MEMBERS(OdDbBlockVisibilityParameter); /** \details Default constructor */ OdDbBlockVisibilityParameter(); /** \details * Returns if the parameter is in a valid state */ bool isInitialized() const; /** \details * Sets that the parameter is in a valid state */ void setInitialized(bool); /** \details * Returns the name of the parameter */ OdString visibilityName() const; /** \details * Sets the name of the parameter */ void setVisibilityName(const OdString&); /** \details * Returns the description of the parameter */ OdString visibilityDescription() const; /** \details * Sets the description of the parameter */ void setVisibilityDescription(const OdString&); /** \details * Returns the number of visibility states */ int numberOfVisibilityStates() const; /** \details * Sets current visibility state. (Throws OdError(eInvalidIndex) if the index is invalid) */ void setCurrentVisibilityState(int index); /** \details * Returns the index of the current visibility state */ int currentVisibilityState() const; /** \details * Returns the list of entities in the block that the visibility parameter is aware of */ void blockEntityList(OdDbObjectIdArray&) const; /** \details * Returns the list of entities participating in this visibility state */ void blockElementList(OdDbObjectIdArray& elements) const; /** \details * Set the list of all the block entities */ void setBlockEntityList(const OdDbObjectIdArray&); /** \details * Clears the list of visibility states */ void clearListOfVisibilityStates(); /** \details * Returns visibility state at the give index. (Returns false if the index is invalid) * "ents" is an array of block entities, "nodes" is an array of block authoring elements */ bool visibilityState(int index, OdString& name, OdDbObjectIdArray& ents, OdDbObjectIdArray& nodes) const; /** \details * sets visibility state at the given index * "ents" is an array of block entities, "nodes" is an array of block authoring elements * if the index in greater or equal than the number of existing states, new state is appended at the end */ void setVisibilityState(int index, const OdString& name, const OdDbObjectIdArray& ents, const OdDbObjectIdArray& nodes); /** \details * Returns the list of entities visible in the current visibility set * Returns false if the parameter is in invalid state (uninitialized) */ bool listVisibleEntities(OdDbObjectIdArray& ents); /** \details * Deletes visibility state at the given index * (Throws OdError(eInvalidIndex) if the index is invalid) */ void deleteVisibilityState(int index); /** \details * Returns the name of the current visibility state (or an empty string if it is not set) */ OdString currentVisibilityStateName() const; }; typedef OdSmartPtr OdDbBlockVisibilityParameterPtr; #endif // _DbBlockVisibilityParameter_h_Included_