/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #include "OdaCommon.h" #include "../Include/DWGConstraintsModule.h" #include "StaticRxObject.h" #include "DWGAssocActionPE.h" #include "DbAssoc2dConstraintGroup.h" #include "DWGCommands.h" #include "DbHostAppServices.h" static OdStaticRxObject DWGAssocActionPE; // geom static OdStaticRxObject constraintPerpendicularCommand; static OdStaticRxObject constraintParallelCommand; static OdStaticRxObject constraintTangentCommand; static OdStaticRxObject constraintSmoothCommand; static OdStaticRxObject constraintSymmetricCommand; static OdStaticRxObject constraintEqualCommand; static OdStaticRxObject constraintCoincidentCommand; static OdStaticRxObject constraintCollinearCommand; static OdStaticRxObject constraintConcentricCommand; static OdStaticRxObject constraintFixCommand; static OdStaticRxObject constraintHorizontalCommand; static OdStaticRxObject constraintVerticalCommand; // dim static OdStaticRxObject constraintAlignedDimCommand; static OdStaticRxObject constraint2LineAngularDimCommand; static OdStaticRxObject constraint3PointAngularDimCommand; static OdStaticRxObject constraintRadialDimCommand; static OdStaticRxObject constraintDiamDimCommand; static OdStaticRxObject constraintHorizontalDimCommand; static OdStaticRxObject constraintVerticalDimCommand; // convert static OdStaticRxObject dcconvert; // delete static OdStaticRxObject delConstraintCommand; // autoconstrain static OdStaticRxObject autoConstrainCommand; //DD:EXPORT_ON ODRX_DEFINE_DYNAMIC_MODULE(CsConstraintsModule); //DD:EXPORT_OFF void CsConstraintsModule::initApp() { ::odrxDynamicLinker()->loadModule(DbConstraintsModuleName, false); DWGAssocActionPE::rxInit(); OdDbAssoc2dConstraintGroup::desc()->module()->addRef(); // lock OdDbAssoc2dConstraintGroup::desc()->addX(AssocActionPE::desc(), &DWGAssocActionPE); OdEdCommandStackPtr pCommands = odedRegCmds(); pCommands->addCommand(&constraintPerpendicularCommand); pCommands->addCommand(&constraintParallelCommand); pCommands->addCommand(&constraintTangentCommand); pCommands->addCommand(&constraintSmoothCommand); pCommands->addCommand(&constraintSymmetricCommand); pCommands->addCommand(&constraintEqualCommand); pCommands->addCommand(&constraintCoincidentCommand); pCommands->addCommand(&constraintCollinearCommand); pCommands->addCommand(&constraintConcentricCommand); pCommands->addCommand(&constraintFixCommand); pCommands->addCommand(&constraintHorizontalCommand); pCommands->addCommand(&constraintVerticalCommand); pCommands->addCommand(&constraintAlignedDimCommand); pCommands->addCommand(&constraint2LineAngularDimCommand); pCommands->addCommand(&constraint3PointAngularDimCommand); pCommands->addCommand(&constraintRadialDimCommand); pCommands->addCommand(&constraintDiamDimCommand); pCommands->addCommand(&constraintHorizontalDimCommand); pCommands->addCommand(&constraintVerticalDimCommand); pCommands->addCommand(&dcconvert); pCommands->addCommand(&delConstraintCommand); pCommands->addCommand(&autoConstrainCommand); } void CsConstraintsModule::uninitApp() { OdEdCommandStackPtr pCommands = odedRegCmds(); pCommands->removeCmd(constraintPerpendicularCommand.groupName(), constraintPerpendicularCommand.globalName()); pCommands->removeCmd(constraintParallelCommand.groupName(), constraintParallelCommand.globalName()); pCommands->removeCmd(constraintTangentCommand.groupName(), constraintTangentCommand.globalName()); pCommands->removeCmd(constraintSmoothCommand.groupName(), constraintSmoothCommand.globalName()); pCommands->removeCmd(constraintSymmetricCommand.groupName(), constraintSymmetricCommand.globalName()); pCommands->removeCmd(constraintEqualCommand.groupName(), constraintEqualCommand.globalName()); pCommands->removeCmd(constraintCoincidentCommand.groupName(), constraintCoincidentCommand.globalName()); pCommands->removeCmd(constraintCollinearCommand.groupName(), constraintCollinearCommand.globalName()); pCommands->removeCmd(constraintConcentricCommand.groupName(), constraintConcentricCommand.globalName()); pCommands->removeCmd(constraintFixCommand.groupName(), constraintFixCommand.globalName()); pCommands->removeCmd(constraintHorizontalCommand.groupName(), constraintHorizontalCommand.globalName()); pCommands->removeCmd(constraintVerticalCommand.groupName(), constraintVerticalCommand.globalName()); pCommands->removeCmd(constraintAlignedDimCommand.groupName(), constraintAlignedDimCommand.globalName()); pCommands->removeCmd(constraint2LineAngularDimCommand.groupName(), constraint2LineAngularDimCommand.globalName()); pCommands->removeCmd(constraint3PointAngularDimCommand.groupName(), constraint3PointAngularDimCommand.globalName()); pCommands->removeCmd(constraintRadialDimCommand.groupName(), constraintRadialDimCommand.globalName()); pCommands->removeCmd(constraintDiamDimCommand.groupName(), constraintDiamDimCommand.globalName()); pCommands->removeCmd(constraintHorizontalDimCommand.groupName(), constraintHorizontalDimCommand.globalName()); pCommands->removeCmd(constraintVerticalDimCommand.groupName(), constraintVerticalDimCommand.globalName()); pCommands->removeCmd(dcconvert.groupName(), dcconvert.globalName()); pCommands->removeCmd(delConstraintCommand.groupName(), delConstraintCommand.globalName()); pCommands->removeCmd(autoConstrainCommand.groupName(), autoConstrainCommand.globalName()); OdDbAssoc2dConstraintGroup::desc()->delX(AssocActionPE::desc()); OdDbAssoc2dConstraintGroup::desc()->module()->release(); // unlock DWGAssocActionPE::rxUninit(); }