follow-up source typos
This commit is contained in:
@@ -115,19 +115,19 @@ void ViewProviderOriginGroupExtension::extensionUpdateData( const App::Property*
|
||||
|
||||
void ViewProviderOriginGroupExtension::slotChangedObjectApp ( const App::DocumentObject& obj) {
|
||||
auto* group = getExtendedViewProvider()->getObject()->getExtensionByType<App::OriginGroupExtension>();
|
||||
if ( group && group->hasObject (&obj, /*recusive=*/ true ) ) {
|
||||
if ( group && group->hasObject (&obj, /*recursive=*/ true ) ) {
|
||||
updateOriginSize ();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderOriginGroupExtension::slotChangedObjectGui ( const Gui::ViewProviderDocumentObject& vp) {
|
||||
if ( !vp.isDerivedFrom ( Gui::ViewProviderOriginFeature::getClassTypeId () )) {
|
||||
// Ignore origins to avoid infinite recursion (not likely in a well-formed focument,
|
||||
// Ignore origins to avoid infinite recursion (not likely in a well-formed document,
|
||||
// but may happen in documents designed in old versions of assembly branch )
|
||||
auto* group = getExtendedViewProvider()->getObject()->getExtensionByType<App::OriginGroupExtension>();
|
||||
App::DocumentObject *obj = vp.getObject ();
|
||||
|
||||
if ( group && obj && group->hasObject (obj, /*recusive=*/ true ) ) {
|
||||
if ( group && obj && group->hasObject (obj, /*recursive=*/ true ) ) {
|
||||
updateOriginSize ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
|
||||
typedef Base::Vector3f vec3f;
|
||||
|
||||
class SymetricMatrix {
|
||||
class SymmetricMatrix {
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
|
||||
SymetricMatrix(double c=0) { for (std::size_t i=0;i<10;++i ) m[i] = c; }
|
||||
SymmetricMatrix(double c=0) { for (std::size_t i=0;i<10;++i ) m[i] = c; }
|
||||
|
||||
SymetricMatrix(double m11, double m12, double m13, double m14,
|
||||
SymmetricMatrix(double m11, double m12, double m13, double m14,
|
||||
double m22, double m23, double m24,
|
||||
double m33, double m34,
|
||||
double m44) {
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
// Make plane
|
||||
|
||||
SymetricMatrix(double a,double b,double c,double d)
|
||||
SymmetricMatrix(double a,double b,double c,double d)
|
||||
{
|
||||
m[0] = a*a; m[1] = a*b; m[2] = a*c; m[3] = a*d;
|
||||
m[4] = b*b; m[5] = b*c; m[6] = b*d;
|
||||
@@ -58,15 +58,15 @@ public:
|
||||
return det;
|
||||
}
|
||||
|
||||
const SymetricMatrix operator+(const SymetricMatrix& n) const
|
||||
const SymmetricMatrix operator+(const SymmetricMatrix& n) const
|
||||
{
|
||||
return SymetricMatrix( m[0]+n[0], m[1]+n[1], m[2]+n[2], m[3]+n[3],
|
||||
m[4]+n[4], m[5]+n[5], m[6]+n[6],
|
||||
return SymmetricMatrix( m[0]+n[0], m[1]+n[1], m[2]+n[2], m[3]+n[3]
|
||||
m[4]+n[4], m[5]+n[5], m[6]+n[6],
|
||||
m[ 7]+n[ 7], m[ 8]+n[8 ],
|
||||
m[ 9]+n[9 ]);
|
||||
}
|
||||
|
||||
SymetricMatrix& operator+=(const SymetricMatrix& n)
|
||||
SymmetricMatrix& operator+=(const SymmetricMatrix& n)
|
||||
{
|
||||
m[0]+=n[0]; m[1]+=n[1]; m[2]+=n[2]; m[3]+=n[3];
|
||||
m[4]+=n[4]; m[5]+=n[5]; m[6]+=n[6]; m[7]+=n[7];
|
||||
@@ -82,7 +82,7 @@ class Simplify
|
||||
{
|
||||
public:
|
||||
struct Triangle { int v[3];double err[4];int deleted,dirty;vec3f n; };
|
||||
struct Vertex { vec3f p;int tstart,tcount;SymetricMatrix q;int border;};
|
||||
struct Vertex { vec3f p;int tstart,tcount;SymmetricMatrix q;int border;};
|
||||
struct Ref { int tid,tvertex; };
|
||||
std::vector<Triangle> triangles;
|
||||
std::vector<Vertex> vertices;
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
private:
|
||||
// Helper functions
|
||||
|
||||
double vertex_error(SymetricMatrix q, double x, double y, double z);
|
||||
double vertex_error(SymmetricMatrix q, double x, double y, double z);
|
||||
double calculate_error(int id_v1, int id_v2, vec3f &p_result);
|
||||
bool flipped(vec3f p,int i0,int i1,Vertex &v0,Vertex &v1,std::vector<int> &deleted);
|
||||
void update_triangles(int i0,Vertex &v,std::vector<int> &deleted,int &deleted_triangles);
|
||||
@@ -324,7 +324,7 @@ void Simplify::update_mesh(int iteration)
|
||||
if (iteration == 0)
|
||||
{
|
||||
for (std::size_t i=0;i<vertices.size();++i)
|
||||
vertices[i].q=SymetricMatrix(0.0);
|
||||
vertices[i].q=SymmetricMatrix(0.0);
|
||||
|
||||
for (std::size_t i=0;i<triangles.size();++i)
|
||||
{
|
||||
@@ -336,7 +336,7 @@ void Simplify::update_mesh(int iteration)
|
||||
n.Normalize();
|
||||
t.n=n;
|
||||
for (std::size_t j=0;j<3;++j)
|
||||
vertices[t.v[j]].q = vertices[t.v[j]].q+SymetricMatrix(n.x,n.y,n.z,-n.Dot(p[0]));
|
||||
vertices[t.v[j]].q = vertices[t.v[j]].q+SymmetricMatrix(n.x,n.y,n.z,-n.Dot(p[0]));
|
||||
}
|
||||
for (std::size_t i=0;i<triangles.size();++i)
|
||||
{
|
||||
@@ -470,7 +470,7 @@ void Simplify::compact_mesh()
|
||||
|
||||
// Error between vertex and Quadric
|
||||
|
||||
double Simplify::vertex_error(SymetricMatrix q, double x, double y, double z)
|
||||
double Simplify::vertex_error(SymmetricMatrix q, double x, double y, double z)
|
||||
{
|
||||
return q[0]*x*x + 2*q[1]*x*y + 2*q[2]*x*z + 2*q[3]*x + q[4]*y*y
|
||||
+ 2*q[5]*y*z + 2*q[6]*y + q[7]*z*z + 2*q[8]*z + q[9];
|
||||
@@ -482,7 +482,7 @@ double Simplify::calculate_error(int id_v1, int id_v2, vec3f &p_result)
|
||||
{
|
||||
// compute interpolated vertex
|
||||
|
||||
SymetricMatrix q = vertices[id_v1].q + vertices[id_v2].q;
|
||||
SymmetricMatrix q = vertices[id_v1].q + vertices[id_v2].q;
|
||||
bool border = vertices[id_v1].border & vertices[id_v2].border;
|
||||
double error=0;
|
||||
double det = q.det(0, 1, 2, 1, 4, 5, 2, 5, 7);
|
||||
|
||||
@@ -49,22 +49,22 @@
|
||||
|
||||
// Colormap for Coordinate grid
|
||||
#declare scalemap = color_map {
|
||||
[0.000 color GridCol1] // Begin of red bar for main unit
|
||||
[lWidth color GridCol1] // End of red bar
|
||||
[(0.001+lWidth) color GridTran] // Beginn of first gap
|
||||
[0.000 color GridCol1] // Beginning of red bar for main unit
|
||||
[lWidth color GridCol1] // End of red bar
|
||||
[(0.001+lWidth) color GridTran] // Beginning of first gap
|
||||
[0.249 color GridTran] // End of first gap
|
||||
[0.250 color GridCol2] // Begin of yellow bar for sub unit
|
||||
[0.250 color GridCol2] // Beginning of yellow bar for sub unit
|
||||
[(0.250+lWidth) color GridCol2] // End of yellow bar
|
||||
[(0.251+lWidth) color GridTran] // Beginn of second gap
|
||||
[(0.251+lWidth) color GridTran] // Beginning of second gap
|
||||
[0.499 color GridTran] // End of first gap
|
||||
[0.500 color GridCol2] // Begin of yellow bar for sub unit
|
||||
[(0.500+lWidth) color GridCol2] // End of yellow bar
|
||||
[(0.501+lWidth) color GridTran] // Beginn of second gap
|
||||
[0.500 color GridCol2] // Beginning of yellow bar for sub unit
|
||||
[(0.500+lWidth) color GridCol2] // End of yellow bar
|
||||
[(0.501+lWidth) color GridTran] // Beginning of second gap
|
||||
[0.749 color GridTran] // End of first gap
|
||||
[0.750 color GridCol2] // Begin of yellow bar for sub unit
|
||||
[0.750 color GridCol2] // Beginning of yellow bar for sub unit
|
||||
[(0.750+lWidth) color GridCol2] // End of yellow bar
|
||||
[(0.751+lWidth) color GridTran] // Beginn of second gap
|
||||
[1.0 color GridTran] // End of second gap
|
||||
[(0.751+lWidth) color GridTran] // Beginning of second gap
|
||||
[1.0 color GridTran] // End of second gap
|
||||
};
|
||||
|
||||
// finish for objects
|
||||
|
||||
@@ -144,7 +144,7 @@ void ElementView::contextMenuEvent (QContextMenuEvent* event)
|
||||
CONTEXT_ITEM("Constraint_Perpendicular","Perpendicular Constraint","Sketcher_ConstrainPerpendicular",doPerpendicularConstraint,true)
|
||||
CONTEXT_ITEM("Constraint_Tangent","Tangent Constraint","Sketcher_ConstrainTangent",doTangentConstraint,true)
|
||||
CONTEXT_ITEM("Constraint_EqualLength","Equal Length","Sketcher_ConstrainEqual",doEqualConstraint,true)
|
||||
CONTEXT_ITEM("Constraint_Symmetric","Symmetric","Sketcher_ConstrainSymmetric",doSymetricConstraint,true)
|
||||
CONTEXT_ITEM("Constraint_Symmetric","Symmetric","Sketcher_ConstrainSymmetric",doSymmetricConstraint,true)
|
||||
CONTEXT_ITEM("Sketcher_ConstrainLock","Lock Constraint","Sketcher_ConstrainLock",doLockConstraint,true)
|
||||
CONTEXT_ITEM("Constraint_HorizontalDistance","Horizontal Distance","Sketcher_ConstrainDistanceX",doHorizontalDistance,true)
|
||||
CONTEXT_ITEM("Constraint_VerticalDistance","Vertical Distance","Sketcher_ConstrainDistanceY",doVerticalDistance,true)
|
||||
@@ -189,7 +189,7 @@ CONTEXT_MEMBER_DEF("Sketcher_ConstrainRadius",doRadiusConstraint)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_ConstrainAngle",doAngleConstraint)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_ConstrainEqual",doEqualConstraint)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_ConstrainPointOnObject",doPointOnObjectConstraint)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_ConstrainSymmetric",doSymetricConstraint)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_ConstrainSymmetric",doSymmetricConstraint)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_ConstrainTangent",doTangentConstraint)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_CloseShape",doCloseShape)
|
||||
CONTEXT_MEMBER_DEF("Sketcher_ConnectLines",doConnect)
|
||||
|
||||
@@ -71,7 +71,7 @@ protected Q_SLOTS:
|
||||
void doAngleConstraint();
|
||||
void doEqualConstraint();
|
||||
void doPointOnObjectConstraint();
|
||||
void doSymetricConstraint();
|
||||
void doSymmetricConstraint();
|
||||
void doTangentConstraint();
|
||||
// Other Commands
|
||||
void doToggleConstruction();
|
||||
|
||||
Reference in New Issue
Block a user