Drawing: Apply clang format

This commit is contained in:
wmayer
2023-09-10 12:33:49 +02:00
committed by wwmayer
parent ebcd846d09
commit 789912d745
52 changed files with 2650 additions and 2106 deletions

View File

@@ -22,11 +22,11 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <sstream>
#include <sstream>
# include <BRep_Builder.hxx>
# include <Standard_Failure.hxx>
# include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <Standard_Failure.hxx>
#include <TopoDS_Compound.hxx>
#endif
#include "FeatureProjection.h"
@@ -37,38 +37,43 @@ using namespace Drawing;
PROPERTY_SOURCE(Drawing::FeatureProjection, Part::Feature)
FeatureProjection::FeatureProjection()
FeatureProjection::FeatureProjection()
{
static const char *group = "Projection";
ADD_PROPERTY_TYPE(Source ,(nullptr),group,App::Prop_None,"Shape to project");
ADD_PROPERTY_TYPE(Direction, (Base::Vector3d(0, 0, 1)), group, App::Prop_None,
static const char* group = "Projection";
ADD_PROPERTY_TYPE(Source, (nullptr), group, App::Prop_None, "Shape to project");
ADD_PROPERTY_TYPE(Direction,
(Base::Vector3d(0, 0, 1)),
group,
App::Prop_None,
"Projection direction");
ADD_PROPERTY_TYPE(VCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(Rg1LineVCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(RgNLineVCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(OutLineVCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(IsoLineVCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(HCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(Rg1LineHCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(RgNLineHCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(OutLineHCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(IsoLineHCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(VCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(Rg1LineVCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(RgNLineVCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(OutLineVCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(IsoLineVCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(HCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(Rg1LineHCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(RgNLineHCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(OutLineHCompound, (true), group, App::Prop_None, "Projection parameter");
ADD_PROPERTY_TYPE(IsoLineHCompound, (true), group, App::Prop_None, "Projection parameter");
}
FeatureProjection::~FeatureProjection()
{
}
{}
App::DocumentObjectExecReturn *FeatureProjection::execute(void)
App::DocumentObjectExecReturn* FeatureProjection::execute(void)
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link) {
return new App::DocumentObjectExecReturn("No object linked");
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
}
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
}
const TopoDS_Shape& shape = static_cast<Part::Feature*>(link)->Shape.getShape().getShape();
if (shape.IsNull())
if (shape.IsNull()) {
return new App::DocumentObjectExecReturn("Linked shape object is empty");
}
try {
const Base::Vector3d& dir = Direction.getValue();
@@ -77,26 +82,36 @@ App::DocumentObjectExecReturn *FeatureProjection::execute(void)
TopoDS_Compound comp;
BRep_Builder builder;
builder.MakeCompound(comp);
if (!alg.V.IsNull() && VCompound.getValue())
if (!alg.V.IsNull() && VCompound.getValue()) {
builder.Add(comp, alg.V);
if (!alg.V1.IsNull() && Rg1LineVCompound.getValue())
}
if (!alg.V1.IsNull() && Rg1LineVCompound.getValue()) {
builder.Add(comp, alg.V1);
if (!alg.VN.IsNull() && RgNLineVCompound.getValue())
}
if (!alg.VN.IsNull() && RgNLineVCompound.getValue()) {
builder.Add(comp, alg.VN);
if (!alg.VO.IsNull() && OutLineVCompound.getValue())
}
if (!alg.VO.IsNull() && OutLineVCompound.getValue()) {
builder.Add(comp, alg.VO);
if (!alg.VI.IsNull() && IsoLineVCompound.getValue())
}
if (!alg.VI.IsNull() && IsoLineVCompound.getValue()) {
builder.Add(comp, alg.VI);
if (!alg.H.IsNull() && HCompound.getValue())
}
if (!alg.H.IsNull() && HCompound.getValue()) {
builder.Add(comp, alg.H);
if (!alg.H1.IsNull() && Rg1LineHCompound.getValue())
}
if (!alg.H1.IsNull() && Rg1LineHCompound.getValue()) {
builder.Add(comp, alg.H1);
if (!alg.HN.IsNull() && RgNLineHCompound.getValue())
}
if (!alg.HN.IsNull() && RgNLineHCompound.getValue()) {
builder.Add(comp, alg.HN);
if (!alg.HO.IsNull() && OutLineHCompound.getValue())
}
if (!alg.HO.IsNull() && OutLineHCompound.getValue()) {
builder.Add(comp, alg.HO);
if (!alg.HI.IsNull() && IsoLineHCompound.getValue())
}
if (!alg.HI.IsNull() && IsoLineHCompound.getValue()) {
builder.Add(comp, alg.HI);
}
Shape.setValue(comp);
return App::DocumentObject::StdReturn;