Sketcher: Solver - add map for Internal Alignment geometry
This commit is contained in:
committed by
Chris Hennes
parent
dd64ab8ea0
commit
a199afad5f
@@ -111,6 +111,8 @@ void Sketch::clear()
|
||||
pDependencyGroups.clear();
|
||||
solverExtensions.clear();
|
||||
|
||||
internalAlignmentGeometryMap.clear();
|
||||
|
||||
// deleting the geometry copied into this sketch
|
||||
for (std::vector<GeoDef>::iterator it = Geoms.begin(); it != Geoms.end(); ++it)
|
||||
if (it->geo) delete it->geo;
|
||||
@@ -230,6 +232,8 @@ int Sketch::setUpSketch(const std::vector<Part::Geometry *> &GeoList,
|
||||
Base::Console().Log("\n");
|
||||
#endif //DEBUG_BLOCK_CONSTRAINT
|
||||
|
||||
buildInternalAlignmentGeometryMap(ConstraintList);
|
||||
|
||||
addGeometry(intGeoList,onlyBlockedGeometry);
|
||||
int extStart=Geoms.size();
|
||||
addGeometry(extGeoList, true);
|
||||
@@ -314,6 +318,15 @@ int Sketch::setUpSketch(const std::vector<Part::Geometry *> &GeoList,
|
||||
return GCSsys.dofsNumber();
|
||||
}
|
||||
|
||||
void Sketch::buildInternalAlignmentGeometryMap(const std::vector<Constraint *> &constraintList)
|
||||
{
|
||||
for(auto* c : constraintList) {
|
||||
if(c->Type==InternalAlignment){
|
||||
internalAlignmentGeometryMap[c->First]=c->Second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Sketch::fixParametersAndDiagnose(std::vector<double *> ¶ms_to_block)
|
||||
{
|
||||
if(!params_to_block.empty()) { // only there are parameters to fix
|
||||
|
||||
@@ -455,6 +455,9 @@ protected:
|
||||
// map of geoIds to corresponding solverextensions. This is useful when solved geometry is NOT to be assigned to the SketchObject
|
||||
std::vector<std::shared_ptr<SolverGeometryExtension>> solverExtensions;
|
||||
|
||||
// maps a geoid corresponding to an internalgeometry (focus,knot,pole) to the geometry it defines (ellipse, hyperbola, B-Spline)
|
||||
std::map< int, int > internalAlignmentGeometryMap;
|
||||
|
||||
std::vector < std::set < std::pair< int, Sketcher::PointPos>>> pDependencyGroups;
|
||||
|
||||
// this map is intended to convert a parameter (double *) into a GeoId/PointPos and parameter number
|
||||
@@ -520,6 +523,8 @@ private:
|
||||
|
||||
void clearTemporaryConstraints();
|
||||
|
||||
void buildInternalAlignmentGeometryMap(const std::vector<Constraint *> &constraintList);
|
||||
|
||||
int internalSolve(std::string & solvername, int level = 0);
|
||||
|
||||
/// checks if the index bounds and converts negative indices to positive
|
||||
|
||||
Reference in New Issue
Block a user