/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// /************************************************************************/ /* Defines entry points for the DLL */ /************************************************************************/ //#include "stdafx.h" #include "OdaCommon.h" #include "DgAutoplantCylinder.h" #include "DgAutoplantCone.h" #include "DgAutoplantBox.h" #include "OdDgAutoplantEntitiesModule.h" #include "RxDynamicModule.h" #include "DgExtraElementCustomizer.h" #include "DgAutoplantEntityProperties.h" namespace OdDgAutoplantEntitiesModuleMembers { OdArray properties; }; #if defined(_TOOLKIT_IN_DLL_) && defined(_MSC_VER) // MacOS X dynamic library loading. //#ifdef _TOOLKIT_IN_DLL_ extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID ) { switch ( dwReason ) { case DLL_PROCESS_ATTACH: // remove this if you need per-thread initialization DisableThreadLibraryCalls( (HMODULE)hInstance ); break; } return TRUE; } #endif //_TOOLKIT_IN_DLL_ // MacOS X dynamic library loading. using namespace OdDgAutoplantEntitiesModuleMembers; ODRX_DEFINE_DYNAMIC_MODULE(OdDgAutoplantEntitiesModule); ODRX_NO_CONS_DEFINE_MEMBERS(OdDgAutoplantEntitiesModule, OdRxModule); OdDgAutoplantEntitiesModule::OdDgAutoplantEntitiesModule() { } OdDgAutoplantEntitiesModule::~OdDgAutoplantEntitiesModule() { } void OdDgAutoplantEntitiesModule::initApp() { OdDgAutoplantCylinder::rxInit(); OdDgAutoplantCone::rxInit(); OdDgAutoplantBox::rxInit(); OdDgAutoplantSphere::rxInit(); OdDgAutoplantTorus::rxInit(); OdDgAutoplantDome::rxInit(); OdDgAutoplantBolt::rxInit(); OdDgExtraElementCustomizationServices::setupExtraElementClass(OdDgAutoplantCylinder::kType, OdDgAutoplantCylinder::desc()); OdDgExtraElementCustomizationServices::setupExtraElementClass(OdDgAutoplantCone::kType, OdDgAutoplantCone::desc()); OdDgExtraElementCustomizationServices::setupExtraElementClass(OdDgAutoplantBox::kType, OdDgAutoplantBox::desc()); OdDgExtraElementCustomizationServices::setupExtraElementClass(OdDgAutoplantSphere::kType, OdDgAutoplantSphere::desc()); OdDgExtraElementCustomizationServices::setupExtraElementClass(OdDgAutoplantTorus::kType, OdDgAutoplantTorus::desc()); OdDgExtraElementCustomizationServices::setupExtraElementClass(OdDgAutoplantDome::kType, OdDgAutoplantDome::desc()); OdDgExtraElementCustomizationServices::setupExtraElementClass(OdDgAutoplantBolt::kType, OdDgAutoplantBolt::desc()); OdDgAutoplantCylinder::desc()->addX(OdDgGripPointsPE::desc(), &m_AutoplantCylinderGP); OdDgAutoplantCone::desc()->addX(OdDgGripPointsPE::desc(), &m_AutoplantConeGP); OdDgAutoplantBox::desc()->addX(OdDgGripPointsPE::desc(), &m_AutoplantBoxGP); OdDgAutoplantSphere::desc()->addX(OdDgGripPointsPE::desc(), &m_AutoplantSphereGP); OdDgAutoplantTorus::desc()->addX(OdDgGripPointsPE::desc(), &m_AutoplantTorusGP); OdDgAutoplantDome::desc()->addX(OdDgGripPointsPE::desc(), &m_AutoplantDomeGP); OdDgAutoplantBolt::desc()->addX(OdDgGripPointsPE::desc(), &m_AutoplantBoltGP); ::odrxDynamicLinker()->loadModule(L"RxProperties"); ::odrxSetMemberConstructor(OdDgAutoplantCylinder::desc(), constructOdDgAutoplantCylinderProperties, 0); ::odrxSetMemberConstructor(OdDgAutoplantCone::desc(), constructOdDgAutoplantConeProperties, 0); ::odrxSetMemberConstructor(OdDgAutoplantBox::desc(), constructOdDgAutoplantBoxProperties, 0); ::odrxSetMemberConstructor(OdDgAutoplantSphere::desc(), constructOdDgAutoplantSphereProperties, 0); ::odrxSetMemberConstructor(OdDgAutoplantTorus::desc(), constructOdDgAutoplantTorusProperties, 0); ::odrxSetMemberConstructor(OdDgAutoplantDome::desc(), constructOdDgAutoplantDomeProperties, 0); ::odrxSetMemberConstructor(OdDgAutoplantBolt::desc(), constructOdDgAutoplantBoltProperties, 0); } void OdDgAutoplantEntitiesModule::uninitApp() { for (unsigned i = 0; i < properties.size(); ++i) OdRxMember::deleteMember(properties[i]); properties.clear(); OdDgAutoplantCylinder::desc()->delX(OdDgGripPointsPE::desc()); OdDgAutoplantCone::desc()->delX(OdDgGripPointsPE::desc()); OdDgAutoplantBox::desc()->delX(OdDgGripPointsPE::desc()); OdDgAutoplantSphere::desc()->delX(OdDgGripPointsPE::desc()); OdDgAutoplantTorus::desc()->delX(OdDgGripPointsPE::desc()); OdDgAutoplantDome::desc()->delX(OdDgGripPointsPE::desc()); OdDgAutoplantBolt::desc()->delX(OdDgGripPointsPE::desc()); OdDgExtraElementCustomizationServices::removeExtraElementClass(OdDgAutoplantCylinder::kType); OdDgExtraElementCustomizationServices::removeExtraElementClass(OdDgAutoplantCone::kType); OdDgExtraElementCustomizationServices::removeExtraElementClass(OdDgAutoplantBox::kType); OdDgExtraElementCustomizationServices::removeExtraElementClass(OdDgAutoplantSphere::kType); OdDgExtraElementCustomizationServices::removeExtraElementClass(OdDgAutoplantTorus::kType); OdDgExtraElementCustomizationServices::removeExtraElementClass(OdDgAutoplantDome::kType); OdDgExtraElementCustomizationServices::removeExtraElementClass(OdDgAutoplantBolt::kType); OdDgAutoplantBolt::rxUninit(); OdDgAutoplantDome::rxUninit(); OdDgAutoplantTorus::rxUninit(); OdDgAutoplantSphere::rxUninit(); OdDgAutoplantBox::rxUninit(); OdDgAutoplantCylinder::rxUninit(); OdDgAutoplantCone::rxUninit(); } void OdDgAutoplantEntitiesModule::constructOdDgAutoplantCylinderProperties(OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDgAutoplantCylinderCenter1Property::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantCylinderCenter2Property::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantCylinderRadiusProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantCylinderDrawStartCapFlagProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantCylinderDrawEndCapFlagProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantCylinderFlagsProperty::createObject(b.owner())); b.add(properties.last()); } void OdDgAutoplantEntitiesModule::constructOdDgAutoplantConeProperties(OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDgAutoplantConeCenter1Property::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantConeCenter2Property::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantConeCenter2OffsetProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantConeRadius1Property::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantConeRadius2Property::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantConeDrawStartCapFlagProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantConeDrawEndCapFlagProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantConeFlagsProperty::createObject(b.owner())); b.add(properties.last()); } void OdDgAutoplantEntitiesModule::constructOdDgAutoplantBoxProperties(OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDgAutoplantBoxBaseCenterProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxTopCenterProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxWidthDirectionProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxTopCenterOffsetProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxBaseLengthProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxBaseWidthProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxTopLengthProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxTopWidthProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoxFlagsProperty::createObject(b.owner())); b.add(properties.last()); } void OdDgAutoplantEntitiesModule::constructOdDgAutoplantSphereProperties(OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDgAutoplantSphereOriginProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantSphereDirectionProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantSphereRadiusProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantSphereFlagsProperty::createObject(b.owner())); b.add(properties.last()); } void OdDgAutoplantEntitiesModule::constructOdDgAutoplantTorusProperties(OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDgAutoplantTorusOriginProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusDirectionProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusRefVectorProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusMajorRadiusProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusMinorStartRadiusProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusMinorEndRadiusProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusStartAngleProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusSweepAngleProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantTorusFlagsProperty::createObject(b.owner())); b.add(properties.last()); } void OdDgAutoplantEntitiesModule::constructOdDgAutoplantDomeProperties(OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDgAutoplantDomeOriginProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantDomeDirectionProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantDomeRadiusProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantDomeHeightProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantDomeFlagsProperty::createObject(b.owner())); b.add(properties.last()); } void OdDgAutoplantEntitiesModule::constructOdDgAutoplantBoltProperties(OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDgAutoplantBoltOriginProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoltDirectionProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoltRadiusProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoltStemLengthProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoltVisibleInShadedRegenProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDgAutoplantBoltFlagsProperty::createObject(b.owner())); b.add(properties.last()); }