/////////////////////////////////////////////////////////////////////////////// // 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 _DbBlockElement_h_Included_ #define _DbBlockElement_h_Included_ #include "DbEvalGraph.h" #include "IntArray.h" #include "Ge/GePoint3dArray.h" class OdDbBlockTableRecord; class OdDbBlockRepresentationContext; class OdDbBlockElementEntity; #define ODDB_EVAL_DECLARE_MEMBERS(ClassName) \ ODDB_DECLARE_MEMBERS(ClassName);\ OdResult dwgInFields(OdDbDwgFiler* pFiler);\ void dwgOutFields(OdDbDwgFiler* pFiler) const;\ OdResult dxfInFields(OdDbDxfFiler* pFiler);\ void dxfOutFields(OdDbDxfFiler* pFiler) const /** \details Base class for all the dynamic block elements (actions, grips, parameters) The only evaluation graph members that are not OdDbBlockElement may be of type OdDbBlockGripExpr (grip point helpers) */ class DYNBLOCKS_EXPORT OdDbBlockElement : public OdDbEvalConnectable { public: ODDB_EVAL_DECLARE_MEMBERS(OdDbBlockElement); //!DOM OdDbEvalConnectable interface overrides virtual OdResult subErase(bool erasing) override; virtual void adjacentEdgeAdded(OdDbEvalNodeId fromId, OdDbEvalNodeId toId, bool isInvertible) override; virtual void addedToGraph(OdDbEvalGraph* pGraph) override; virtual void adjacentNodeRemoved( OdDbEvalNodeId ) override; virtual bool evaluate( const OdDbEvalContext* ) override; virtual bool connectionAllowed(const OdString&, OdDbEvalNodeId, const OdString&) const override; virtual bool connectTo(const OdString&, OdDbEvalNodeId, const OdString&) override; virtual bool disconnectFrom(const OdString&, OdDbEvalNodeId, const OdString&) override; virtual bool hasConnectionNamed(const OdString&) const override; virtual bool getConnectedNames(const OdString&, OdDbEvalNodeId, OdStringArray&) const override; virtual bool getConnectedObjects(const OdString&, OdDbEvalNodeIdArray&) const override; virtual void getConnectionNames(OdStringArray&) const override; virtual DwgDataType getConnectionType(const OdString& name) const override; virtual OdDbEvalVariant getConnectionValue(const OdString& name) const override; /** \details Returns the element name */ virtual OdString name() const; /** \details Sets the element name */ virtual void setName(const OdString&); /** \details Returns the current audit alert state */ virtual unsigned long alertState() const; /** \details Runs checks the element consistency and sets the audit alert state */ virtual void auditAlertState(); /** \details Returns the current element major version (for the instance data) */ virtual OdDb::DwgVersion getInstanceVersion(); /** \details Returns the current element minor version (for the instance data) */ virtual OdDb::MaintReleaseVer getInstanceMaintenanceVersion(); /** \details Returns the stretch points for the element */ virtual void getStretchPoints(OdGePoint3dArray& points) const; /** \details Moves the element by the the stretch points */ virtual void moveStretchPointsAt(const OdIntArray& indices, const OdGeVector3d& offset); /** \details Returns true if history record is required for that element */ virtual bool historyRequired() const; /** \details Returns true if the name is unique within the graph. If prefix is passed, it is appended sequential numbers, until the result is unique */ static bool isNameUnique(class OdDbEvalGraph* graph, const OdString& name, OdString* prefix = nullptr); /** \details Returns true if instance data should be saved for that element */ virtual bool hasInstanceData()const; /** \details Load element instance data from xdata chain. Returns true if successful. */ virtual bool loadInstanceData(const OdResBuf*, bool bRequireEvaluate = false); /** \details Returns the istance data to be saved for that element */ virtual OdResBufPtr saveInstanceData()const; /** \details Returns the if the element is a member of the curent visibility set */ virtual bool isMemberOfCurrentVisibilitySet() const; /** \details Sets the if the element is a member of the curent visibility set */ virtual void setMemberOfCurrentVisibilitySet(bool); /** \details Transforms the element definition by the given matrix. (Editor operation) */ virtual void transformDefinitionBy(const OdGeMatrix3d&); /** \details Transforms the element by the given matrix. (Block evaluation operation) */ virtual OdResult transformBy( const OdGeMatrix3d& ); virtual void modified(const OdDbObject* pObject) override; /** \details Synchronize the element with the editor representation entity */ virtual OdResult sync(OdDbBlockElementEntity*); /** \details Returns the representation entity for that element in BEDIT mode */ virtual OdDbObjectId getEntity() const; /** \details Returns the class of the editor representation entity for that element */ virtual OdRxClass *getRxEntity() const; /** \details Event fired by the block editor at the opening */ virtual bool onBeginEdit(OdDbBlockTableRecord*); /** \details Event fired by the block editor at the end of the opening */ virtual void onBeginEditEnded(OdDbObjectId entityId, OdDbObjectId blockId); /** \details Event fired by the block editor before saving the changes (e.g. to shift the block contents by the base point) */ virtual void onBeginSaveStarted(OdDbObjectId entityId, OdDbObjectId blockId); /** \details Event fired by the block editor after saving the changes (to restore edited block contents, e.g. base point application) */ virtual void onBeginSaveEnded(OdDbObjectId entityId, OdDbObjectId blockId); /** \details Event fired by the block editor at closing */ virtual bool onEndEdit(OdDbBlockTableRecord*); /** \details Event fired by the block editor at the beginning of the block editor closing */ virtual void onEndEditStarted(OdDbObjectId entityId, OdDbObjectId blockId); }; typedef OdSmartPtrOdDbBlockElementPtr; #endif // _DbBlockElement_h_Included_