From 15bd298c3a4c39f6970fd145dcec8ff2495cecda Mon Sep 17 00:00:00 2001 From: dkulikov Date: Mon, 23 Sep 2024 16:29:40 +0000 Subject: [PATCH] code style fix --- src/STEPConstruct/STEPConstruct_Styles.cxx | 100 ++++++++++----------- src/STEPConstruct/STEPConstruct_Styles.hxx | 85 +++++++++--------- 2 files changed, 92 insertions(+), 93 deletions(-) diff --git a/src/STEPConstruct/STEPConstruct_Styles.cxx b/src/STEPConstruct/STEPConstruct_Styles.cxx index e8e8d02c55..ca897a1190 100644 --- a/src/STEPConstruct/STEPConstruct_Styles.cxx +++ b/src/STEPConstruct/STEPConstruct_Styles.cxx @@ -81,25 +81,25 @@ namespace // (even if color and transparency data couldn't be extracted // for some reason), otherwise returns false. //======================================================================= - Standard_Boolean ProcessAsSurfaceStyleRendering ( + Standard_Boolean ProcessAsSurfaceStyleRendering( const StepVisual_SurfaceStyleElementSelect& theSSES, - Handle (StepVisual_Colour)& theRenderColour, + Handle(StepVisual_Colour)& theRenderColour, Standard_Real& theRenderTransparency) { - const Handle (StepVisual_SurfaceStyleRendering) aSSR = theSSES.SurfaceStyleRendering(); + const Handle(StepVisual_SurfaceStyleRendering) aSSR = theSSES.SurfaceStyleRendering(); if (aSSR.IsNull()) { return Standard_False; } theRenderColour = aSSR->SurfaceColour(); theRenderTransparency = 0.0; - const Handle (StepVisual_SurfaceStyleRenderingWithProperties) aSSRWP = - Handle (StepVisual_SurfaceStyleRenderingWithProperties)::DownCast (aSSR); + const Handle(StepVisual_SurfaceStyleRenderingWithProperties) aSSRWP = + Handle(StepVisual_SurfaceStyleRenderingWithProperties)::DownCast(aSSR); if (aSSRWP.IsNull()) { return Standard_True; } - const Handle (StepVisual_HArray1OfRenderingPropertiesSelect) aHARP = aSSRWP->Properties(); + const Handle(StepVisual_HArray1OfRenderingPropertiesSelect) aHARP = aSSRWP->Properties(); if (aHARP.IsNull()) { return Standard_True; @@ -107,8 +107,8 @@ namespace for (Standard_Integer aPropIndex = 1; aPropIndex <= aHARP->Length(); ++aPropIndex) { - const Handle (StepVisual_SurfaceStyleTransparent) aSST = - aHARP->Value (aPropIndex).SurfaceStyleTransparent(); + const Handle(StepVisual_SurfaceStyleTransparent) aSST = + aHARP->Value(aPropIndex).SurfaceStyleTransparent(); if (!aSST.IsNull()) { theRenderTransparency = aSST->Transparency(); @@ -125,16 +125,16 @@ namespace // (even if boundary color data couldn't be extracted // for some reason), otherwise returns false. //======================================================================= - Standard_Boolean ProcessAsSurfaceStyleBoundary ( + Standard_Boolean ProcessAsSurfaceStyleBoundary( const StepVisual_SurfaceStyleElementSelect& theSSES, - Handle (StepVisual_Colour)& theBoundaryColour) + Handle(StepVisual_Colour)& theBoundaryColour) { - const Handle (StepVisual_SurfaceStyleBoundary) aSSB = theSSES.SurfaceStyleBoundary(); + const Handle(StepVisual_SurfaceStyleBoundary) aSSB = theSSES.SurfaceStyleBoundary(); if (aSSB.IsNull()) { return Standard_False; } - const Handle (StepVisual_CurveStyle) aCS = aSSB->StyleOfBoundary(); + const Handle(StepVisual_CurveStyle) aCS = aSSB->StyleOfBoundary(); if (aCS.IsNull()) { return Standard_True; @@ -152,12 +152,12 @@ namespace // couldn't be extracted or some reason), otherwise returns // false. //======================================================================= - Standard_Boolean ProcessAsSurfaceStyleFillArea ( + Standard_Boolean ProcessAsSurfaceStyleFillArea( const StepVisual_SurfaceStyleElementSelect& theSSES, const StepVisual_SurfaceSide theSide, - Handle (StepVisual_Colour)& theSurfaceColour) + Handle(StepVisual_Colour)& theSurfaceColour) { - const Handle (StepVisual_SurfaceStyleFillArea) aSSFA = theSSES.SurfaceStyleFillArea(); + const Handle(StepVisual_SurfaceStyleFillArea) aSSFA = theSSES.SurfaceStyleFillArea(); if (aSSFA.IsNull()) { return Standard_False; @@ -166,7 +166,7 @@ namespace { return Standard_True; } - const Handle (StepVisual_FillAreaStyle) aFAS = aSSFA->FillArea(); + const Handle(StepVisual_FillAreaStyle) aFAS = aSSFA->FillArea(); if (aFAS.IsNull()) { return Standard_True; @@ -174,8 +174,8 @@ namespace for (Standard_Integer aFSSIndex = 1; aFSSIndex <= aFAS->NbFillStyles(); aFSSIndex++) { - const StepVisual_FillStyleSelect aFSS = aFAS->FillStylesValue (aFSSIndex); - const Handle (StepVisual_FillAreaStyleColour) aFASC = aFSS.FillAreaStyleColour(); + const StepVisual_FillStyleSelect aFSS = aFAS->FillStylesValue(aFSSIndex); + const Handle(StepVisual_FillAreaStyleColour) aFASC = aFSS.FillAreaStyleColour(); if (!aFASC.IsNull() && theSurfaceColour.IsNull()) //abv 30 Mar 00: trj3_s1-pe.stp { theSurfaceColour = aFASC->FillColour(); @@ -193,28 +193,28 @@ namespace // (even if no data at all could be extracted for some reason), // otherwise returns false. //======================================================================= - Standard_Boolean ProcessAsSurfaceStyleUsage (const StepVisual_PresentationStyleSelect& thePSS, - Handle (StepVisual_Colour)& theSurfaceColour, - Handle (StepVisual_Colour)& theBoundaryColour, - Handle (StepVisual_Colour)& theRenderColour, - Standard_Real& theRenderTransparency) + Standard_Boolean ProcessAsSurfaceStyleUsage(const StepVisual_PresentationStyleSelect& thePSS, + Handle(StepVisual_Colour)& theSurfaceColour, + Handle(StepVisual_Colour)& theBoundaryColour, + Handle(StepVisual_Colour)& theRenderColour, + Standard_Real& theRenderTransparency) { - const Handle (StepVisual_SurfaceStyleUsage) aSSU = thePSS.SurfaceStyleUsage(); + const Handle(StepVisual_SurfaceStyleUsage) aSSU = thePSS.SurfaceStyleUsage(); if (aSSU.IsNull()) { return Standard_False; } - const Handle (StepVisual_SurfaceSideStyle) aSSS = aSSU->Style(); + const Handle(StepVisual_SurfaceSideStyle) aSSS = aSSU->Style(); for (Standard_Integer aSSESIndex = 1; aSSESIndex <= aSSS->NbStyles(); ++aSSESIndex) { - const StepVisual_SurfaceStyleElementSelect aSSES = aSSS->StylesValue (aSSESIndex); + const StepVisual_SurfaceStyleElementSelect aSSES = aSSS->StylesValue(aSSESIndex); // SurfaceStyleElementSelect can be of only one of the following types: // SurfaceStyleFillArea, SurfaceStyleBoundary, SurfaceStyleRendering. // So we're using && operator to stop as soon as this type is processed. - ProcessAsSurfaceStyleFillArea (aSSES, aSSU->Side(), theSurfaceColour) - && ProcessAsSurfaceStyleBoundary (aSSES, theBoundaryColour) - && ProcessAsSurfaceStyleRendering (aSSES, theRenderColour, theRenderTransparency); + ProcessAsSurfaceStyleFillArea(aSSES, aSSU->Side(), theSurfaceColour) + && ProcessAsSurfaceStyleBoundary(aSSES, theBoundaryColour) + && ProcessAsSurfaceStyleRendering(aSSES, theRenderColour, theRenderTransparency); } return Standard_True; } @@ -227,10 +227,10 @@ namespace // (even if curve color data couldn't be extracted // for some reason), otherwise returns false. //======================================================================= - Standard_Boolean ProcessAsCurveStyle (const StepVisual_PresentationStyleSelect& thePSS, - Handle (StepVisual_Colour)& theCurveColour) + Standard_Boolean ProcessAsCurveStyle(const StepVisual_PresentationStyleSelect& thePSS, + Handle(StepVisual_Colour)& theCurveColour) { - const Handle (StepVisual_CurveStyle) aCS = thePSS.CurveStyle(); + const Handle(StepVisual_CurveStyle) aCS = thePSS.CurveStyle(); if (aCS.IsNull()) { return Standard_False; @@ -765,13 +765,13 @@ Handle(StepVisual_PresentationStyleAssignment) STEPConstruct_Styles::GetColorPSA //function : GetColors //purpose : //======================================================================= -Standard_Boolean STEPConstruct_Styles::GetColors (const Handle (StepVisual_StyledItem)& theStyle, - Handle (StepVisual_Colour)& theSurfaceColour, - Handle (StepVisual_Colour)& theBoundaryColour, - Handle (StepVisual_Colour)& theCurveColour, - Handle (StepVisual_Colour)& theRenderColour, - Standard_Real& theRenderTransparency, - Standard_Boolean& theIsComponent) const +Standard_Boolean STEPConstruct_Styles::GetColors(const Handle(StepVisual_StyledItem)& theStyle, + Handle(StepVisual_Colour)& theSurfaceColour, + Handle(StepVisual_Colour)& theBoundaryColour, + Handle(StepVisual_Colour)& theCurveColour, + Handle(StepVisual_Colour)& theRenderColour, + Standard_Real& theRenderTransparency, + Standard_Boolean& theIsComponent) const { theSurfaceColour.Nullify(); theBoundaryColour.Nullify(); @@ -781,7 +781,7 @@ Standard_Boolean STEPConstruct_Styles::GetColors (const Handle (StepVisual_Style // parse on styles for (Standard_Integer aPSAIndex = 1; aPSAIndex <= theStyle->NbStyles(); ++aPSAIndex) { - const Handle (StepVisual_PresentationStyleAssignment) aPSA = theStyle->StylesValue (aPSAIndex); + const Handle(StepVisual_PresentationStyleAssignment) aPSA = theStyle->StylesValue(aPSAIndex); if (aPSA.IsNull() || aPSA->Styles().IsNull()) { continue; @@ -790,16 +790,16 @@ Standard_Boolean STEPConstruct_Styles::GetColors (const Handle (StepVisual_Style for (Standard_Integer aPSSIndex = 1; aPSSIndex <= aPSA->NbStyles(); ++aPSSIndex) { - const StepVisual_PresentationStyleSelect aPSS = aPSA->StylesValue (aPSSIndex); - // PresentationStyleSelect can be of only one of the following types: - // SurfaceStyleUsage, CurveStyle. - // So we're using && operator to stop as soon as this type is processed. - ProcessAsSurfaceStyleUsage (aPSS, - theSurfaceColour, - theBoundaryColour, - theRenderColour, - theRenderTransparency) - && ProcessAsCurveStyle (aPSS, theCurveColour); + const StepVisual_PresentationStyleSelect aPSS = aPSA->StylesValue(aPSSIndex); + // PresentationStyleSelect can be of only one of the following types: + // SurfaceStyleUsage, CurveStyle. + // So we're using && operator to stop as soon as this type is processed. + ProcessAsSurfaceStyleUsage(aPSS, + theSurfaceColour, + theBoundaryColour, + theRenderColour, + theRenderTransparency) + && ProcessAsCurveStyle(aPSS, theCurveColour); } } return !theSurfaceColour.IsNull() || !theBoundaryColour.IsNull() || !theCurveColour.IsNull() diff --git a/src/STEPConstruct/STEPConstruct_Styles.hxx b/src/STEPConstruct/STEPConstruct_Styles.hxx index d897d1c238..f6d207860a 100644 --- a/src/STEPConstruct/STEPConstruct_Styles.hxx +++ b/src/STEPConstruct/STEPConstruct_Styles.hxx @@ -57,67 +57,67 @@ public: Standard_EXPORT STEPConstruct_Styles(); //! Creates a tool and initializes it - Standard_EXPORT STEPConstruct_Styles (const Handle (XSControl_WorkSession)& WS); + Standard_EXPORT STEPConstruct_Styles(const Handle(XSControl_WorkSession)& WS); //! Initializes tool; returns True if succeeded - Standard_EXPORT Standard_Boolean Init (const Handle (XSControl_WorkSession)& WS); + Standard_EXPORT Standard_Boolean Init(const Handle(XSControl_WorkSession)& WS); //! Returns number of defined styles Standard_EXPORT Standard_Integer NbStyles() const; //! Returns style with given index - Standard_EXPORT Handle (StepVisual_StyledItem) Style (const Standard_Integer i) const; + Standard_EXPORT Handle(StepVisual_StyledItem) Style(const Standard_Integer i) const; //! Returns number of override styles Standard_EXPORT Standard_Integer NbRootStyles() const; //! Returns override style with given index - Standard_EXPORT Handle (StepVisual_StyledItem) RootStyle (const Standard_Integer i) const; + Standard_EXPORT Handle(StepVisual_StyledItem) RootStyle(const Standard_Integer i) const; //! Clears all defined styles and PSA sequence Standard_EXPORT void ClearStyles(); //! Adds a style to a sequence - Standard_EXPORT void AddStyle (const Handle (StepVisual_StyledItem)& style); + Standard_EXPORT void AddStyle(const Handle(StepVisual_StyledItem)& style); //! Create a style linking giving PSA to the item, and add it to the //! sequence of stored styles. If Override is not Null, then //! the resulting style will be of the subtype OverridingStyledItem. - Standard_EXPORT Handle (StepVisual_StyledItem) AddStyle ( - const Handle (StepRepr_RepresentationItem)& item, - const Handle (StepVisual_PresentationStyleAssignment)& PSA, - const Handle (StepVisual_StyledItem)& Override); + Standard_EXPORT Handle(StepVisual_StyledItem) AddStyle( + const Handle(StepRepr_RepresentationItem)& item, + const Handle(StepVisual_PresentationStyleAssignment)& PSA, + const Handle(StepVisual_StyledItem)& Override); //! Create a style linking giving PSA to the Shape, and add it to the //! sequence of stored styles. If Override is not Null, then //! the resulting style will be of the subtype OverridingStyledItem. //! The Sape is used to find corresponding STEP entity by call to //! STEPConstruct::FindEntity(), then previous method is called. - Standard_EXPORT Handle (StepVisual_StyledItem) AddStyle ( - const TopoDS_Shape& Shape, - const Handle (StepVisual_PresentationStyleAssignment)& PSA, - const Handle (StepVisual_StyledItem)& Override); + Standard_EXPORT Handle(StepVisual_StyledItem) AddStyle( + const TopoDS_Shape& Shape, + const Handle(StepVisual_PresentationStyleAssignment)& PSA, + const Handle(StepVisual_StyledItem)& Override); //! Create MDGPR, fill it with all the styles previously defined, //! and add it to the model Standard_EXPORT Standard_Boolean - CreateMDGPR (const Handle (StepRepr_RepresentationContext)& Context, - Handle (StepVisual_MechanicalDesignGeometricPresentationRepresentation)& MDGPR, - Handle (StepData_StepModel)& theStepModel); + CreateMDGPR(const Handle(StepRepr_RepresentationContext)& Context, + Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation)& MDGPR, + Handle(StepData_StepModel)& theStepModel); //! Create MDGPR, fill it with all the styles previously defined, //! and add it to the model //! IMPORTANT: must be null when use for NAUO colors //! initialised only for SHUO case. Standard_EXPORT Standard_Boolean - CreateNAUOSRD (const Handle (StepRepr_RepresentationContext)& Context, - const Handle (StepShape_ContextDependentShapeRepresentation)& CDSR, - const Handle (StepRepr_ProductDefinitionShape)& initPDS); + CreateNAUOSRD(const Handle(StepRepr_RepresentationContext)& Context, + const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR, + const Handle(StepRepr_ProductDefinitionShape)& initPDS); //! Searches the STEP model for the RepresentationContext in which //! given shape is defined. This context (if found) can be used //! then in call to CreateMDGPR() - Standard_EXPORT Handle (StepRepr_RepresentationContext) FindContext ( + Standard_EXPORT Handle(StepRepr_RepresentationContext) FindContext( const TopoDS_Shape& Shape) const; //! Searches the STEP model for the MDGPR or DM entities @@ -127,60 +127,59 @@ public: //! Searches the STEP model for the INISIBILITY entities //! (which bring styles) and fills out sequence of styles Standard_EXPORT Standard_Boolean - LoadInvisStyles (Handle (TColStd_HSequenceOfTransient)& InvSyles) const; + LoadInvisStyles(Handle(TColStd_HSequenceOfTransient)& InvSyles) const; //! Create a PresentationStyleAssignment entity which defines //! two colors (for filling surfaces and curves) //! if isForNAUO true then returns PresentationStyleByContext - Standard_EXPORT Handle (StepVisual_PresentationStyleAssignment) MakeColorPSA ( - const Handle (StepRepr_RepresentationItem)& item, - const Handle (StepVisual_Colour)& SurfCol, - const Handle (StepVisual_Colour)& CurveCol, - const Handle (StepVisual_Colour)& RenderCol, - const Standard_Real RenderTransp, - const Standard_Boolean isForNAUO = Standard_False) const; + Standard_EXPORT Handle(StepVisual_PresentationStyleAssignment) MakeColorPSA( + const Handle(StepRepr_RepresentationItem)& item, + const Handle(StepVisual_Colour)& SurfCol, + const Handle(StepVisual_Colour)& CurveCol, + const Handle(StepVisual_Colour)& RenderCol, + const Standard_Real RenderTransp, + const Standard_Boolean isForNAUO = Standard_False) const; //! Returns a PresentationStyleAssignment entity which defines //! surface and curve colors as Col. This PSA is either created //! or taken from internal map where all PSAs created by this //! method are remembered. - Standard_EXPORT Handle (StepVisual_PresentationStyleAssignment) GetColorPSA ( - const Handle (StepRepr_RepresentationItem)& item, - const Handle (StepVisual_Colour)& Col); + Standard_EXPORT Handle(StepVisual_PresentationStyleAssignment) GetColorPSA( + const Handle(StepRepr_RepresentationItem)& item, + const Handle(StepVisual_Colour)& Col); //! Extract color definitions from the style entity //! For each type of color supported, result can be either //! NULL if it is not defined by that style, or last //! definition (if they are 1 or more) - Standard_EXPORT Standard_Boolean GetColors (const Handle (StepVisual_StyledItem)& theStyle, - Handle (StepVisual_Colour)& theSurfaceColour, - Handle (StepVisual_Colour)& theBoundaryColour, - Handle (StepVisual_Colour)& theCurveColour, - Handle (StepVisual_Colour)& theRenderColour, - Standard_Real& theRenderTransparency, - Standard_Boolean& theIsComponent) const; + Standard_EXPORT Standard_Boolean GetColors(const Handle(StepVisual_StyledItem)& theStyle, + Handle(StepVisual_Colour)& theSurfaceColour, + Handle(StepVisual_Colour)& theBoundaryColour, + Handle(StepVisual_Colour)& theCurveColour, + Handle(StepVisual_Colour)& theRenderColour, + Standard_Real& theRenderTransparency, + Standard_Boolean& theIsComponent) const; //! Create STEP color entity by given Quantity_Color //! The analysis is performed for whether the color corresponds to //! one of standard colors predefined in STEP. In that case, //! PredefinedColour entity is created instead of RGBColour - Standard_EXPORT static Handle (StepVisual_Colour) EncodeColor (const Quantity_Color& Col); + Standard_EXPORT static Handle(StepVisual_Colour) EncodeColor(const Quantity_Color& Col); //! Create STEP color entity by given Quantity_Color //! The analysis is performed for whether the color corresponds to //! one of standard colors predefined in STEP. In that case, //! PredefinedColour entity is created instead of RGBColour - Standard_EXPORT static Handle (StepVisual_Colour) EncodeColor ( + Standard_EXPORT static Handle(StepVisual_Colour) EncodeColor( const Quantity_Color& Col, STEPConstruct_DataMapOfAsciiStringTransient& DPDCs, STEPConstruct_DataMapOfPointTransient& ColRGBs); //! Decodes STEP color and fills the Quantity_Color. //! Returns True if OK or False if color is not recognized - Standard_EXPORT static Standard_Boolean DecodeColor (const Handle (StepVisual_Colour)& Colour, - Quantity_Color& Col); + Standard_EXPORT static Standard_Boolean DecodeColor(const Handle(StepVisual_Colour)& Colour, + Quantity_Color& Col); -protected: private: TColStd_IndexedDataMapOfTransientTransient myMapOfStyles; TColStd_IndexedMapOfTransient myStyles;