/////////////////////////////////////////////////////////////////////////////// // 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 "COdPowerTowerSolidEntity.h" #include "EmbeddedASMEntPE.h" #include const int COdPowerTowerSolidEntity::kVersion = 1; ODRX_DEFINE_MEMBERS_EX(COdPowerTowerSolidEntity, // ClassName OdDb3dSolid, // ParentClass DBOBJECT_CONSTR, // DOCREATE OdDb::kDHL_CURRENT, // DwgVer OdDb::kMReleaseCurrent, // MaintVer 1025, // nProxyFlags (kEraseAllowed | kDisableProxyWarning) L"COdPowerTowerSolidEntity", // DWG class name L"CODPOWERTOWERSOLIDENTITY", // DxfName L"ExAssocNetwork", // AppName OdRx::kMTLoading | OdRx::kHistoryAware); COdPowerTowerSolidEntity::COdPowerTowerSolidEntity() { } COdPowerTowerSolidEntity::~COdPowerTowerSolidEntity() { } int COdPowerTowerSolidEntity::getVersion() { return kVersion; } void COdPowerTowerSolidEntity::createTowerGeometry(OdGePoint3d basePnt) { assertWriteEnabled(); OdDb3dSolidPtrArray solids; //Main column OdDb3dSolidPtr pMainCol = OdDb3dSolid::createObject(); pMainCol->createBox(100., 100., 8000.); pMainCol->transformBy(OdGeMatrix3d::translation(OdGePoint3d(0, 0, 4000) - OdGePoint3d::kOrigin)); solids.append(pMainCol); //beam OdDb3dSolidPtr pbeam1 = OdDb3dSolid::createObject(); pbeam1->createBox(100., 2000., 100.); pbeam1->transformBy(OdGeMatrix3d::translation(OdGePoint3d(0, 0, 8050) - OdGePoint3d::kOrigin)); solids.append(pbeam1); OdGeMatrix3d transforms[3] = { OdGeMatrix3d::translation(OdGePoint3d(0, 0, 8175) - OdGePoint3d::kOrigin), OdGeMatrix3d::translation(OdGePoint3d(0, 700, 8175) - OdGePoint3d::kOrigin), OdGeMatrix3d::translation(OdGePoint3d(0, -700, 8175) - OdGePoint3d::kOrigin) }; //insulators for (int i = 0; i < 3; i++) { OdDb3dSolidPtr pCyl = OdDb3dSolid::createObject(); pCyl->createFrustum(150, 15, 15, 15); pCyl->transformBy(transforms[i]); solids.append(pCyl); OdGePoint3d coneStartPnt(0, 0, 150); for (int j = 0; j < 3; j++) { OdGePoint3d conePnt = coneStartPnt + OdGeVector3d(0, 0, 1) * j * 100; OdGeMatrix3d coneTr = OdGeMatrix3d::translation(conePnt - OdGePoint3d::kOrigin); OdDb3dSolidPtr pCone = OdDb3dSolid::createObject(); pCone->createFrustum(150, 100, 100, 0); pCone->transformBy(transforms[i]); pCone->transformBy(coneTr); solids.append(pCone); } } for (auto solid : solids) booleanOper(OdDb::BoolOperType::kBoolUnite, solid); OdGeMatrix3d matr = OdGeMatrix3d::translation(basePnt - OdGePoint3d::kOrigin); transformBy(matr); }