/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2024, 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-2024 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 _ODDBMULTIMODESGRIPPE_INCLUDED #define _ODDBMULTIMODESGRIPPE_INCLUDED #include "RxObject.h" #include "DbEntity.h" /** \details This class is the Multi Modes Grip Points Protocol Extension class. */ class TOOLKIT_EXPORT OdDbMultiModesGripPE : public OdRxObject { public: ODRX_DECLARE_MEMBERS(OdDbMultiModesGripPE); /** \details The type of a grip. */ enum GripType { kPrimary, // The primary grip. Always shown if host's GRIPS variable is not 0; kSecondary // The secondary grip. Only shown when host's GRIPS variable is 2; }; /** \details The numerical identifier of a grip mode. */ enum GripModeIdentifier { kNone = 0, // Default kMove, // Stretch at the grip point kCustomStart = 100 // The start of custom mode types. All custom mode types should be larger than this value. }; /** \details The type of actions the grip editing complex takes when a mode is becoming current. */ enum GripActionType { kDragOn = 0, // Instructs the grip editor to proceed with dragging. The mode specific behavior is determined by object's moveGripPointsAt current mode awareness. kImmediate, // Instructs the grip editor to call moveGripPointsAt once and end dragging sequence. kCommand // External command, specified as GripMode::CommandString, is called. }; /** \details The type of canvas cursor can be specified for each mode. */ enum GripCursorType { kcNone = 0, // No cursor change, using default. kcCrosshairPlus, // Default cursor combined with a plus sign. kcCrosshairMinus, // Default cursor combined with a minus sign. kcCrosshairCurve, // Default cursor combined with a curve sign. kcCrosshairLine, // Default cursor combined with a straight line sign. kcCrosshairAngle // Default cursor combined with an angle sign. For future use. }; /** \details The type that contains all information to present a single mode. */ struct GripMode { GripMode() : Mode(GripModeIdentifier::kMove), CursorType(kcNone), ActionType(kDragOn) {}; unsigned int Mode; // The unique identifier among the collection of modes this PE implements. OdString DisplayString; // The display string of this mode in various UI elements (including haver menu and object context menu). OdString ToolTip; // The string tool tip of this mode. (For future use.) OdString CLIDisplayString; // The command line version of display string for this mode. OdString CLIPromptString; // The command line prompt string when this mode is switched as current. OdString CLIKeywordList; // The command line keyword list associated to CLIPromptString. GripCursorType CursorType; // The type of cursor this mode uses. (For future use.) GripActionType ActionType; // The action type of this mode uses. OdString CommandString; // Optional. If the action type is kCommand, the command used for this mode. }; /** \details Queries an object, on a given grip point, for the available modes it provides. It also returns the mode that is current. \param pThis [in] The OdDbEntity whose modes are requested. The object needs to be open at least for read. \param pGripData [in] The grip whose modes are requested. \param modes [in] The returned array of availabe modes. \param curMode [in] The returned identifier of current mode. \returns true if successful. */ virtual bool getGripModes(const OdDbEntity* pThis, OdDbGripData* pGripData, OdArray& modes, unsigned int& curMode) const = 0; /** \details Gets the current mode identifier. \param pThis [in] The OdDbEntity whose modes are requested. \param pGripData [in] The grip whose modes are requested. \returns identifier of current mode. */ virtual unsigned int mode(OdDbEntity* pThis, OdDbGripData* pGripData) const = 0; /** \details Gets the current mode. \param pThis [in] The OdDbEntity whose current mode is requested. \param pGripData [in] The grip whose mode is requested. \returns mode object which is current. */ virtual GripMode modeEx(OdDbEntity* pThis, OdDbGripData* pGripData) const = 0; /** \details Sets the current mode. \param pThis [in] The OdDbEntity whose current mode is to be set current. \param pGripData [in] The grip whose current mode is to be set current. \param newMode [in] The numerical identifier for the new current mode. \returns true of successful. */ virtual bool setMode(OdDbEntity* pThis, OdDbGripData* pGripData, unsigned int newMode) = 0; /** \details Gets the grip type of a given grip. \param pThis [in] The OdDbEntity whose grip type is requested. \param pGripData [in] The grip whose grip type is requested. \param newMode [in] The numerical identifier for the new current mode. \returns The GripType of the grip. */ virtual GripType gripType(OdDbEntity* pThis, OdDbGripData* pGripData) const = 0; /** \details Resets current mode to default (up to each concrate class to say what is the default). \param pThis [in] The OdDbEntity whose current mode is reset to default. */ virtual void reset(OdDbEntity* pThis) = 0; }; typedef OdSmartPtr OdDbMultiModesGripPEPtr; #endif // _ODDBMULTIMODESGRIPPE_INCLUDED