From: Pasukhin Dmitry Date: Tue, 29 Jul 2025 07:39:07 +0000 (+0100) Subject: Coding - Remove unused dependencies from TKXDEDRAW (#650) X-Git-Tag: V8_0_0_rc2~1 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=783c3440b242277b52f822fde07515bb3aa7c49f;p=occt.git Coding - Remove unused dependencies from TKXDEDRAW (#650) - Removed unused dependency includes from TKXDEDRAW/XDEDRAW module files - Moved dimension type checking methods from STEPCAFControl_GDTProperty to XCAFDimTolObjects_DimensionObject - Updated external library dependencies to remove unused libraries --- diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx index 2706fd494a..d4bada297c 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx @@ -1206,50 +1206,6 @@ Handle(TCollection_HAsciiString) STEPCAFControl_GDTProperty::GetDatumTargetName( //================================================================================================= -Standard_Boolean STEPCAFControl_GDTProperty::IsDimensionalLocation( - const XCAFDimTolObjects_DimensionType theType) -{ - if (theType == XCAFDimTolObjects_DimensionType_Location_None - || theType == XCAFDimTolObjects_DimensionType_Location_CurvedDistance - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter - || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner - || theType == XCAFDimTolObjects_DimensionType_Location_Oriented) - return Standard_True; - return Standard_False; -} - -//================================================================================================= - -Standard_Boolean STEPCAFControl_GDTProperty::IsDimensionalSize( - const XCAFDimTolObjects_DimensionType theType) -{ - if (theType == XCAFDimTolObjects_DimensionType_Size_CurveLength - || theType == XCAFDimTolObjects_DimensionType_Size_Diameter - || theType == XCAFDimTolObjects_DimensionType_Size_SphericalDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_Radius - || theType == XCAFDimTolObjects_DimensionType_Size_SphericalRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius - || theType == XCAFDimTolObjects_DimensionType_Size_Thickness) - return Standard_True; - return Standard_False; -} - -//================================================================================================= - StepDimTol_GeometricToleranceType STEPCAFControl_GDTProperty::GetGeomToleranceType( const XCAFDimTolObjects_GeomToleranceType theType) { diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.hxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.hxx index e7c63335e1..976e2d046a 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.hxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.hxx @@ -94,12 +94,6 @@ public: Standard_EXPORT static Handle(TCollection_HAsciiString) GetDatumTargetName( const XCAFDimTolObjects_DatumTargetType theDatumType); - Standard_EXPORT static Standard_Boolean IsDimensionalLocation( - const XCAFDimTolObjects_DimensionType theType); - - Standard_EXPORT static Standard_Boolean IsDimensionalSize( - const XCAFDimTolObjects_DimensionType theType); - Standard_EXPORT static StepDimTol_GeometricToleranceType GetGeomToleranceType( const XCAFDimTolObjects_GeomToleranceType theType); diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx index f8b9a0455c..cfbf513b04 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -4489,7 +4489,7 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo aConnectionPnts, theLocalFactors); XCAFDimTolObjects_DimensionType aDimType = anObject->GetType(); - if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) + if (XCAFDimTolObjects_DimensionObject::IsDimensionalLocation(aDimType)) { // Dimensional_Location Handle(StepShape_DimensionalLocation) aDim = new StepShape_DimensionalLocation(); @@ -4535,7 +4535,7 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo ->Init(new TCollection_HAsciiString(), Standard_False, NULL, aFirstSA, aSecondSA, aPathSA); aDimension.SetValue(aDim); } - else if (STEPCAFControl_GDTProperty::IsDimensionalSize(aDimType)) + else if (XCAFDimTolObjects_DimensionObject::IsDimensionalSize(aDimType)) { // Dimensional_Size Handle(StepShape_DimensionalSize) aDim = new StepShape_DimensionalSize(); diff --git a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx index 0301243ce4..ee3093d141 100644 --- a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx +++ b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx @@ -446,6 +446,50 @@ void XCAFDimTolObjects_DimensionObject::RemoveDescription(const Standard_Integer //================================================================================================= +Standard_Boolean XCAFDimTolObjects_DimensionObject::IsDimensionalLocation( + const XCAFDimTolObjects_DimensionType theType) +{ + if (theType == XCAFDimTolObjects_DimensionType_Location_None + || theType == XCAFDimTolObjects_DimensionType_Location_CurvedDistance + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter + || theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner + || theType == XCAFDimTolObjects_DimensionType_Location_Oriented) + return Standard_True; + return Standard_False; +} + +//================================================================================================= + +Standard_Boolean XCAFDimTolObjects_DimensionObject::IsDimensionalSize( + const XCAFDimTolObjects_DimensionType theType) +{ + if (theType == XCAFDimTolObjects_DimensionType_Size_CurveLength + || theType == XCAFDimTolObjects_DimensionType_Size_Diameter + || theType == XCAFDimTolObjects_DimensionType_Size_SphericalDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_Radius + || theType == XCAFDimTolObjects_DimensionType_Size_SphericalRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius + || theType == XCAFDimTolObjects_DimensionType_Size_Thickness) + return Standard_True; + return Standard_False; +} + +//================================================================================================= + void XCAFDimTolObjects_DimensionObject::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const { diff --git a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx index 015a6f7b91..8f78fe04cc 100644 --- a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx +++ b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx @@ -292,6 +292,14 @@ public: myDescriptionNames.Append(theName); } + //! Returns true if the dimension type is a location. + Standard_EXPORT static Standard_Boolean IsDimensionalLocation( + const XCAFDimTolObjects_DimensionType theType); + + //! Returns true if the dimension type is a size. + Standard_EXPORT static Standard_Boolean IsDimensionalSize( + const XCAFDimTolObjects_DimensionType theType); + //! Dumps the content of me into the stream Standard_EXPORT void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const; diff --git a/src/Draw/TKXDEDRAW/EXTERNLIB.cmake b/src/Draw/TKXDEDRAW/EXTERNLIB.cmake index 11dc0c6afa..9e38847e44 100644 --- a/src/Draw/TKXDEDRAW/EXTERNLIB.cmake +++ b/src/Draw/TKXDEDRAW/EXTERNLIB.cmake @@ -16,19 +16,10 @@ set(OCCT_TKXDEDRAW_EXTERNAL_LIBS TKTopAlgo TKLCAF TKG3d - TKRWMesh - TKDEOBJ - TKDEGLTF - TKDEPLY - TKDESTL TKMesh TKXSDRAW - TKDECascade - TKDEIGES - TKDESTEP TKDCAF TKViewerTest TKBinXCAF TKXmlXCAF - TKDEVRML ) diff --git a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx index d9fa5af0b7..64cbb961bb 100644 --- a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx +++ b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW.cxx @@ -24,22 +24,13 @@ #include #include #include -#include -#include -#include #include #include #include #include -#include #include #include #include -#include -#include -#include -#include -#include #include #include #include @@ -78,7 +69,6 @@ #include #include #include -#include #include #include #include @@ -1854,9 +1844,6 @@ void XDEDRAW::Init(Draw_Interpretor& di) } initactor = Standard_True; - // Load static variables for STEPCAF (ssv; 16.08.2012) - STEPCAFControl_Controller::Init(); - // Initialize XCAF formats Handle(TDocStd_Application) anApp = DDocStd::GetApplication(); BinXCAFDrivers::DefineFormat(anApp); diff --git a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx index d0cd7a652c..0f5b00d59c 100644 --- a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx +++ b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_GDTs.cxx @@ -21,8 +21,6 @@ #include #include -#include - #include #include #include @@ -402,7 +400,7 @@ static Standard_Integer DumpNbDGTs(Draw_Interpretor& di, Standard_Integer argc, { nbCommon++; } - else if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) + else if (XCAFDimTolObjects_DimensionObject::IsDimensionalLocation(aDimType)) { nbLocation++; } @@ -416,7 +414,7 @@ static Standard_Integer DumpNbDGTs(Draw_Interpretor& di, Standard_Integer argc, nbLocation++; nbWithPath++; } - else if (STEPCAFControl_GDTProperty::IsDimensionalSize(aDimType)) + else if (XCAFDimTolObjects_DimensionObject::IsDimensionalSize(aDimType)) { nbSize++; } diff --git a/src/Draw/TKXSDRAWSTEP/XSDRAWSTEP/XSDRAWSTEP.cxx b/src/Draw/TKXSDRAWSTEP/XSDRAWSTEP/XSDRAWSTEP.cxx index 5889b3be95..3ed5126b29 100644 --- a/src/Draw/TKXSDRAWSTEP/XSDRAWSTEP/XSDRAWSTEP.cxx +++ b/src/Draw/TKXSDRAWSTEP/XSDRAWSTEP/XSDRAWSTEP.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1100,6 +1101,7 @@ void XSDRAWSTEP::Factory(Draw_Interpretor& theDI) { return; } + STEPCAFControl_Controller::Init(); aIsActivated = Standard_True; const char* aGroup = "DE: STEP"; // Step transfer file commands