MOD: SANDBOX clean

clean code
This commit is contained in:
Andrea
2025-03-31 22:23:19 +02:00
committed by Chris Hennes
parent e7d29290b7
commit 94eaba4674
5 changed files with 0 additions and 85 deletions

View File

@@ -211,10 +211,6 @@ Py::Object DocumentObjectProtectorPy::getattr(const char * attr)
App::Property* prop = obj->getPropertyByName(attr);
if (!prop) {
return Py::PythonExtension<DocumentObjectProtectorPy>::getattr(attr);
//std::string s;
//std::ostringstream s_out;
//s_out << "No such attribute '" << attr << "'";
//throw Py::AttributeError(s_out.str());
}
return Py::asObject(prop->getPyObject());

View File

@@ -82,69 +82,9 @@ private:
try {
Base::Vector3d m1 = arc->getCenter();
//Base::Vector3d a3 = arc->getStartPoint();
Base::Vector3d a3 = arc->getEndPoint(true);
//Base::Vector3d l1 = seg->getStartPoint();
Base::Vector3d l2 = seg->getEndPoint();
#if 0
Py::Module pd("FilletArc");
Py::Callable method(pd.getAttr(std::string("makeFilletArc")));
Py::Callable vector(pd.getAttr(std::string("Vector")));
Py::Tuple xyz(3);
Py::Tuple args(6);
xyz.setItem(0, Py::Float(m1.x));
xyz.setItem(1, Py::Float(m1.y));
xyz.setItem(2, Py::Float(m1.z));
args.setItem(0,vector.apply(xyz));
xyz.setItem(0, Py::Float(a3.x));
xyz.setItem(1, Py::Float(a3.y));
xyz.setItem(2, Py::Float(a3.z));
args.setItem(1,vector.apply(xyz));
xyz.setItem(0, Py::Float(l2.x));
xyz.setItem(1, Py::Float(l2.y));
xyz.setItem(2, Py::Float(l2.z));
args.setItem(2,vector.apply(xyz));
xyz.setItem(0, Py::Float((float)0));
xyz.setItem(1, Py::Float((float)0));
xyz.setItem(2, Py::Float((float)1));
args.setItem(3,vector.apply(xyz));
args.setItem(4,Py::Float(radius));
args.setItem(5,Py::Long((int)0));
Py::Tuple ret(method.apply(args));
Py::Object S1(ret.getItem(0));
Py::Object S2(ret.getItem(1));
Py::Object M2(ret.getItem(2));
Base::Vector3d s1, s2, m2;
s1.x = (double)Py::Float(S1.getAttr("x"));
s1.y = (double)Py::Float(S1.getAttr("y"));
s1.z = (double)Py::Float(S1.getAttr("z"));
s2.x = (double)Py::Float(S2.getAttr("x"));
s2.y = (double)Py::Float(S2.getAttr("y"));
s2.z = (double)Py::Float(S2.getAttr("z"));
m2.x = (double)Py::Float(M2.getAttr("x"));
m2.y = (double)Py::Float(M2.getAttr("y"));
m2.z = (double)Py::Float(M2.getAttr("z"));
coords->point.set1Value(0, (float)s1.x,(float)s1.y,(float)s1.z);
coords->point.set1Value(1, (float)m2.x,(float)m2.y,(float)m2.z);
coords->point.set1Value(2, (float)s2.x,(float)s2.y,(float)s2.z);
Base::Console().Message("M1=<%.4f,%.4f>\n", m1.x,m1.y);
Base::Console().Message("M2=<%.4f,%.4f>\n", m2.x,m2.y);
Base::Console().Message("S1=<%.4f,%.4f>\n", s1.x,s1.y);
Base::Console().Message("S2=<%.4f,%.4f>\n", s2.x,s2.y);
Base::Console().Message("P=<%.4f,%.4f>\n", a3.x,a3.y);
Base::Console().Message("Q=<%.4f,%.4f>\n", l2.x,l2.y);
Base::Console().Message("\n");
#else
Py::Module pd("PartDesign");
Py::Callable method(pd.getAttr(std::string("makeFilletArc")));
@@ -154,7 +94,6 @@ private:
args.setItem(2,Py::Vector(l2));
args.setItem(3,Py::Vector(Base::Vector3d(0,0,1)));
args.setItem(4,Py::Float(radius));
//args.setItem(5,Py::Long((int)0));
args.setItem(5,Py::Long((long)1));
Py::Tuple ret(method.apply(args));
Py::Vector S1(ret.getItem(0));
@@ -175,7 +114,6 @@ private:
Base::Console().Message("P=<%.4f,%.4f>\n", a3.x,a3.y);
Base::Console().Message("Q=<%.4f,%.4f>\n", l2.x,l2.y);
Base::Console().Message("\n");
#endif
}
catch (Py::Exception&) {
Base::PyException e; // extract the Python error text

View File

@@ -158,14 +158,12 @@ public:
verticalLayout->addWidget(rbAndroidScheme);
gridLayout->addWidget(ActionGroup1, 0, 1, 1, 1);
verticalSpacer = new QSpacerItem(20, 57, QSizePolicy::Minimum, QSizePolicy::Expanding);
gridLayout->addItem(verticalSpacer, 1, 1, 1, 1);
retranslateUi(MainWindow2);
QMetaObject::connectSlotsByName(MainWindow2);
@@ -246,7 +244,6 @@ public:
verticalLayout_3->addWidget(line_2);
verticalLayout->addLayout(verticalLayout_3);
gridLayout_2 = new QGridLayout();
@@ -308,7 +305,6 @@ public:
verticalLayout_4->addWidget(line);
verticalLayout->addLayout(verticalLayout_4);
verticalLayout_2 = new QVBoxLayout();
@@ -343,10 +339,8 @@ public:
verticalLayout_2->addWidget(ActionLabel3);
verticalLayout->addLayout(verticalLayout_2);
retranslateUi(MainWindow);
} // setupUi

View File

@@ -57,11 +57,8 @@ public:
void setWidget(QWidget* w);
protected:
//virtual void doAction(SoAction * action);
virtual void GLRender(SoGLRenderAction *action);
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center);
//virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
//virtual void rayPick (SoRayPickAction *action);
virtual void generatePrimitives(SoAction *action);
void getQuad(SoState * state, SbVec3f & v0, SbVec3f & v1, SbVec3f & v2, SbVec3f & v3);

View File

@@ -305,7 +305,6 @@ class Drawexporter(object):
spinename = '%s-0-spine' % ob.Name
saveShape(self.csg,self.filename, path,spinename,None,\
self.cleanshape) # placement with shape
#safePlacement(ob.Placement,ob.Name)
self.csg.write('mksweep %s\n' % spinename)
#setsweep
setoptions=[]
@@ -327,9 +326,6 @@ class Drawexporter(object):
sections=ob.Sections
sectionnames = []
for i,subobj in enumerate(ob.Sections):
#process_object(csg,subobj,filename)
#sectionsnames.append(subobj.Name)
#d1['basename']=subobj.Name
sectionname = '%s-0-section-%02d-%s' % (ob.Name,i,subobj.Name)
addoptions=[]
explodeshape = self.alwaysexplode or \
@@ -782,9 +778,6 @@ class Drawexporter(object):
self.csg.write('compound vl v1l vnl vol vil hl h1l hnl hol hil %s\n' % ob.Name)
else:
self.csg.write('compound vl v1l vnl vol vil %s\n' % ob.Name)
#elif ob.isDerivedFrom('Part::FeaturePython') and \
# hasattr(ob.Proxy,'__module__'):
# pass
elif ob.isDerivedFrom('Part::Feature') :
if ob.Shape.isNull(): #would crash in exportBrep otherwise
raise ValueError('Shape of %s is Null' % ob.Name)
@@ -837,9 +830,6 @@ class Drawexporter(object):
names = [name for name in toplevelobjs if name is not False]
self.csg.write('donly %s\n'%(' '.join(names)))
self.export_annotations(objlst)
#for ob in objlst:
# self.process_object(ob,toplevel=toplevel)
#self.write_displayonly(objlst)
def __exit__(self,exc_type, exc_val, exc_tb ):
self.csg.close()