Working revolving part DPG
This commit is contained in:
@@ -53,6 +53,7 @@ const char* DrawProjGroup::ProjectionTypeEnums[] = {"Default",
|
||||
"Third Angle",
|
||||
NULL};
|
||||
|
||||
//default starting dirs & rots
|
||||
const std::map<std::string,Base::Vector3d> DrawProjGroup::m_frameToStdDir = {
|
||||
{ "Front", Base::Vector3d(0, -1, 0) }, //front
|
||||
{ "Rear", Base::Vector3d(0, 1, 0) }, //rear
|
||||
@@ -60,27 +61,26 @@ const std::map<std::string,Base::Vector3d> DrawProjGroup::m_frameToStdDir = {
|
||||
{ "Left", Base::Vector3d(-1, 0, 0) }, //left
|
||||
{ "Top", Base::Vector3d(0, 0, 1) }, //top
|
||||
{ "Bottom", Base::Vector3d(0, 0, -1) }, //bottom
|
||||
{ "FrontBottomLeft", Base::Vector3d(-1, -1, -1) }, //FBL
|
||||
{ "FrontBottomLeft", Base::Vector3d(-1, -1, -1) }, //FBL
|
||||
{ "FrontBottomRight", Base::Vector3d(1, -1, -1) }, //FBR
|
||||
{ "FrontTopLeft", Base::Vector3d(-1,-1,1) }, //FTL
|
||||
{ "FrontTopRight", Base::Vector3d(1, -1, 1) } //FTR
|
||||
{ "FrontTopRight", Base::Vector3d(1, -1, 1) } //FTR
|
||||
};
|
||||
|
||||
const std::map<std::string,Base::Vector3d> DrawProjGroup::m_frameToStdRot = {
|
||||
{ "Front", Base::Vector3d(1, 0, 0) }, //front
|
||||
{ "Rear", Base::Vector3d(-1, 0, 0) }, //rear
|
||||
{ "Right", Base::Vector3d(0, -1, 0) }, //right this makes the first rendering correct, but
|
||||
{ "Left", Base::Vector3d(0, 1, 0) }, //left every 2nd subsequent rendering upside down (ie cube is incorrect)
|
||||
// { "Right", Base::Vector3d(0, 1, 0) }, //right this makes the first rendering upside down
|
||||
// { "Left", Base::Vector3d(0, -1, 0) }, /left but subsequent renderings right side up (ie cube is correct)
|
||||
{ "Right", Base::Vector3d(0, -1, 0) }, //right
|
||||
{ "Left", Base::Vector3d(0, 1, 0) }, //left
|
||||
{ "Top", Base::Vector3d(1, 0, 0) }, //top
|
||||
{ "Bottom", Base::Vector3d(1, 0, 0) }, //bottom
|
||||
{ "FrontBottomLeft", Base::Vector3d(2, -1, 0.5) }, //FBL LFB
|
||||
{ "FrontBottomRight", Base::Vector3d(2, -1, -0.5) }, //FBR RFB
|
||||
{ "FrontTopLeft", Base::Vector3d(2, -1, -0.5) }, //FTL LFT
|
||||
{ "FrontTopRight", Base::Vector3d(2, 1, 0.5) } //FTR RFT
|
||||
{ "FrontBottomLeft", Base::Vector3d(2, 1, 0.5) },
|
||||
{ "FrontBottomRight", Base::Vector3d(2, -1, -0.5) },
|
||||
{ "FrontTopLeft", Base::Vector3d(2, 1, -0.5) },
|
||||
{ "FrontTopRight", Base::Vector3d(2, -1, 0.5) }
|
||||
};
|
||||
|
||||
//one of these is obs??
|
||||
// map of front.dir+front.rot onto config
|
||||
const std::map<std::string,std::string> DrawProjGroup::m_dirRotToConfig = {
|
||||
{"AB","AB"},
|
||||
@@ -171,7 +171,7 @@ DrawProjGroup::~DrawProjGroup()
|
||||
|
||||
void DrawProjGroup::onChanged(const App::Property* prop)
|
||||
{
|
||||
//TODO: For some reason, when the projection type is changed, the isometric views show change appropriately, but the orthographic ones dont... Or vice-versa. why would you change from 1st to 3rd in mid drawing?
|
||||
//TODO: For some reason, when the projection type is changed, the isometric views show change appropriately, but the orthographic ones dont... Or vice-versa. WF: why would you change from 1st to 3rd in mid drawing?
|
||||
//if group hasn't been added to page yet, can't scale or distribute projItems
|
||||
TechDraw::DrawPage *page = getPage();
|
||||
if (!isRestoring() && page) {
|
||||
@@ -441,7 +441,6 @@ bool DrawProjGroup::hasProjection(const char *viewProjType) const
|
||||
|
||||
App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
|
||||
{
|
||||
//Base::Console().Message("TRACE - DPG::addProjection(%s)\n",viewProjType);
|
||||
//if this is the first Projection added, it should automatically be the Anchor/front view
|
||||
// or if viewProjType == "Front" Anchor.setValue(view)
|
||||
DrawProjGroupItem *view( nullptr );
|
||||
@@ -466,9 +465,12 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
|
||||
Anchor.setValue(docObj);
|
||||
view->Direction.setValue(m_frameToStdDir.at("Front")); //just (Base::Vector3d(0.0,-1.0,0.0))
|
||||
view->OrientBasis.setValue(m_frameToStdRot.at("Front"));
|
||||
//view->recomputeFeature();
|
||||
} else {
|
||||
//really need to check with Cube to get current dir & rot
|
||||
//TODO: really need to check with Cube to get current dir & rot this uses initial values from table
|
||||
//if (DPGI(front) and DPGI(right) exist) config = front.face + right.face
|
||||
//
|
||||
//else
|
||||
// use start up values (m_frameToStdDir/m_frameToStdRot)
|
||||
view->Direction.setValue(m_frameToStdDir.at(viewProjType));
|
||||
view->OrientBasis.setValue(m_frameToStdRot.at(viewProjType));
|
||||
}
|
||||
@@ -478,7 +480,6 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
|
||||
view->recomputeFeature();
|
||||
}
|
||||
|
||||
Base::Console().Message("TRACE - DPG::addProjection exits\n");
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -539,13 +540,14 @@ void DrawProjGroup::arrangeViewPointers(DrawProjGroupItem *viewPtrs[10]) const
|
||||
// Iterate through views and populate viewPtrs
|
||||
if ( strcmp(projType, "Third Angle") == 0 ||
|
||||
strcmp(projType, "First Angle") == 0 ) {
|
||||
// Third Angle: FTL T FTRight
|
||||
// L F Right Rear
|
||||
// FBL B FBRight
|
||||
// Third Angle: FTL T FTRight 0 1 2
|
||||
// L F Right Rear 3 4 5 6
|
||||
// FBL B FBRight 7 8 9
|
||||
//
|
||||
// First Angle: FBRight B FBL
|
||||
// Right F L Rear
|
||||
// FTRight T FTL
|
||||
// First Angle: FBRight B FBL 0 1 2
|
||||
// Right F L Rear 3 4 5 6
|
||||
// FTRight T FTL 7 8 9
|
||||
|
||||
bool thirdAngle = (strcmp(projType, "Third Angle") == 0);
|
||||
for (auto it : Views.getValues()) {
|
||||
auto oView( dynamic_cast<DrawProjGroupItem *>(it) );
|
||||
@@ -606,6 +608,7 @@ void DrawProjGroup::makeViewBbs(DrawProjGroupItem *viewPtrs[10],
|
||||
bool DrawProjGroup::distributeProjections()
|
||||
{
|
||||
//TODO: bounding boxes do not take view orientation into account
|
||||
// ie X&Y widths might be swapped on page
|
||||
if (!AutoDistribute.getValue()) {
|
||||
return true;
|
||||
}
|
||||
@@ -623,70 +626,84 @@ bool DrawProjGroup::distributeProjections()
|
||||
Base::BoundBox3d bboxes[10];
|
||||
makeViewBbs(viewPtrs, bboxes);
|
||||
|
||||
// Now that things are setup, do the spacing
|
||||
double scale = Scale.getValue();
|
||||
if (scale < 1.0) scale = 1.0;
|
||||
double xSpacing = scale * spacingX.getValue(); //in mm
|
||||
double ySpacing = scale * spacingY.getValue(); //in mm
|
||||
double xSpacing = spacingX.getValue(); //in mm/scale
|
||||
double ySpacing = spacingY.getValue(); //in mm/scale
|
||||
|
||||
double bigRow = 0.0;
|
||||
double bigCol = 0.0;
|
||||
for (auto& b: bboxes) {
|
||||
if (!b.IsValid()) {
|
||||
continue;
|
||||
}
|
||||
if (b.LengthX() > bigCol) {
|
||||
bigCol = b.LengthX();
|
||||
}
|
||||
if (b.LengthY() > bigRow) {
|
||||
bigRow = b.LengthY();
|
||||
}
|
||||
}
|
||||
|
||||
//if we have iso's, make sure they fit the grid.
|
||||
if (viewPtrs[0] || viewPtrs[2] || viewPtrs[7] || viewPtrs[9]) {
|
||||
bigCol = std::max(bigCol,bigRow);
|
||||
bigRow = bigCol;
|
||||
}
|
||||
|
||||
//viewPtrs
|
||||
// 0 1 2
|
||||
// 3 4 5 6
|
||||
// 7 8 9
|
||||
|
||||
if (viewPtrs[0] && viewPtrs[0]->allowAutoPos() &&
|
||||
bboxes[0].IsValid()) {
|
||||
double displace = std::max(bboxes[0].LengthX() + bboxes[4].LengthX(),
|
||||
bboxes[0].LengthY() + bboxes[4].LengthY());
|
||||
viewPtrs[0]->X.setValue(displace / -2.0 - xSpacing);
|
||||
viewPtrs[0]->Y.setValue(displace / 2.0 + ySpacing);
|
||||
viewPtrs[0]->X.setValue(-bigCol - xSpacing);
|
||||
viewPtrs[0]->Y.setValue(bigRow + ySpacing);
|
||||
}
|
||||
if (viewPtrs[1] && viewPtrs[1]->allowAutoPos() &&
|
||||
bboxes[1].IsValid()) {
|
||||
viewPtrs[1]->Y.setValue((bboxes[1].LengthY() + bboxes[4].LengthY()) / 2.0 + ySpacing);
|
||||
viewPtrs[1]->Y.setValue(bigRow + ySpacing);
|
||||
}
|
||||
if (viewPtrs[2] && viewPtrs[2]->allowAutoPos()
|
||||
) {
|
||||
double displace = std::max(bboxes[2].LengthX() + bboxes[4].LengthX(),
|
||||
bboxes[2].LengthY() + bboxes[4].LengthY());
|
||||
viewPtrs[2]->X.setValue(displace / 2.0 + xSpacing);
|
||||
viewPtrs[2]->Y.setValue(displace / 2.0 + ySpacing);
|
||||
viewPtrs[2]->X.setValue(bigCol + xSpacing);
|
||||
viewPtrs[2]->Y.setValue(bigRow + ySpacing);
|
||||
}
|
||||
if (viewPtrs[3] && viewPtrs[3]->allowAutoPos() &&
|
||||
bboxes[3].IsValid() &&
|
||||
bboxes[4].IsValid()) {
|
||||
viewPtrs[3]->X.setValue((bboxes[3].LengthX() + bboxes[4].LengthX()) / -2.0 - xSpacing);
|
||||
viewPtrs[3]->X.setValue(-bigCol - xSpacing);
|
||||
}
|
||||
if (viewPtrs[4]) { // TODO: Move this check above, and figure out a sane bounding box based on other existing views
|
||||
}
|
||||
if (viewPtrs[5] && viewPtrs[5]->allowAutoPos() &&
|
||||
bboxes[5].IsValid() &&
|
||||
bboxes[4].IsValid()) {
|
||||
viewPtrs[5]->X.setValue((bboxes[5].LengthX() + bboxes[4].LengthX()) / 2.0 + xSpacing);
|
||||
viewPtrs[5]->X.setValue(bigCol + xSpacing);
|
||||
}
|
||||
if (viewPtrs[6] && viewPtrs[6]->allowAutoPos() &&
|
||||
bboxes[6].IsValid()) { //"Rear"
|
||||
if (viewPtrs[5] &&
|
||||
bboxes[5].IsValid()) {
|
||||
viewPtrs[6]->X.setValue(viewPtrs[5]->X.getValue() + bboxes[5].LengthX()/2.0 + xSpacing + bboxes[6].LengthX() / 2.0 );
|
||||
viewPtrs[6]->X.setValue(viewPtrs[5]->X.getValue() + bigCol + xSpacing);
|
||||
}else if (viewPtrs[4] &&
|
||||
bboxes[4].IsValid()) {
|
||||
viewPtrs[6]->X.setValue((bboxes[6].LengthX() + bboxes[4].LengthX()) / 2.0 + xSpacing);
|
||||
viewPtrs[6]->X.setValue(bigCol + xSpacing);
|
||||
}
|
||||
}
|
||||
if (viewPtrs[7] && viewPtrs[7]->allowAutoPos() &&
|
||||
bboxes[7].IsValid()) {
|
||||
double displace = std::max(bboxes[7].LengthX() + bboxes[4].LengthX(),
|
||||
bboxes[7].LengthY() + bboxes[4].LengthY());
|
||||
viewPtrs[7]->X.setValue(displace / -2.0 - xSpacing);
|
||||
viewPtrs[7]->Y.setValue(displace / -2.0 - ySpacing);
|
||||
viewPtrs[7]->X.setValue(-bigCol - xSpacing);
|
||||
viewPtrs[7]->Y.setValue(-bigRow - ySpacing);
|
||||
}
|
||||
if (viewPtrs[8] && viewPtrs[8]->allowAutoPos() &&
|
||||
bboxes[8].IsValid() &&
|
||||
bboxes[4].IsValid()) {
|
||||
viewPtrs[8]->Y.setValue((bboxes[8].LengthY() + bboxes[4].LengthY()) / -2.0 - ySpacing);
|
||||
viewPtrs[8]->Y.setValue(-bigRow - ySpacing);
|
||||
}
|
||||
if (viewPtrs[9] && viewPtrs[9]->allowAutoPos() &&
|
||||
bboxes[9].IsValid()) {
|
||||
double displace = std::max(bboxes[9].LengthX() + bboxes[4].LengthX(),
|
||||
bboxes[9].LengthY() + bboxes[4].LengthY());
|
||||
viewPtrs[9]->X.setValue(displace / 2.0 + xSpacing);
|
||||
viewPtrs[9]->Y.setValue(displace / -2.0 - ySpacing);
|
||||
viewPtrs[9]->X.setValue(bigCol + xSpacing);
|
||||
viewPtrs[9]->Y.setValue(-bigRow - ySpacing);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -782,12 +799,11 @@ bool DrawProjGroup::hasAnchor(void)
|
||||
|
||||
TechDraw::DrawProjGroupItem* DrawProjGroup::getAnchor(void)
|
||||
{
|
||||
// Base::Console().Message("TRACE - DPG::getAnchor() - %s\n",getNameInDocument());
|
||||
DrawProjGroupItem* result = nullptr;
|
||||
App::DocumentObject* docObj = Anchor.getValue();
|
||||
if (docObj == nullptr) {
|
||||
//explode! DPG w/o anchor
|
||||
Base::Console().Message("TRACE - DPG::getAnchor - DPG has no Anchor!!!\n");
|
||||
Base::Console().Error("Error - DPG::getAnchor - DPG has no Anchor!!!\n");
|
||||
} else {
|
||||
result = static_cast<DrawProjGroupItem*>(docObj);
|
||||
}
|
||||
@@ -822,7 +838,6 @@ Base::Vector3d DrawProjGroup::getAnchorDirection(void)
|
||||
|
||||
void DrawProjGroup::updateSecondaryDirs()
|
||||
{
|
||||
// Base::Console().Message("TRACE - DPG::updateSecondaryDirs() - %s\n",getNameInDocument());
|
||||
for (auto& docObj: Views.getValues()) {
|
||||
Base::Vector3d newDir;
|
||||
Base::Vector3d newAxis;
|
||||
@@ -891,88 +906,75 @@ void DrawProjGroup::updateSecondaryDirs()
|
||||
v->OrientBasis.setValue(newAxis);
|
||||
v->recomputeFeature();
|
||||
}
|
||||
// Base::Console().Message("TRACE - DPG::updateSecondaryDirs exits\n");
|
||||
}
|
||||
|
||||
|
||||
void DrawProjGroup::rotateRight()
|
||||
{
|
||||
//Front -> Right -> Rear -> Left -> Front
|
||||
//m_cube->dump("TRACE - DPG::rotR before");
|
||||
m_cube->rotateRight();
|
||||
//m_cube->dump("TRACE - DPG::rotR after");
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
void DrawProjGroup::rotateLeft()
|
||||
{
|
||||
//Front -> Left -> Rear -> Right -> Front
|
||||
//m_cube->dump("TRACE - DPG::rotL before");
|
||||
m_cube->rotateLeft();
|
||||
//m_cube->dump("TRACE - DPG::rotL after");
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
void DrawProjGroup::rotateUp()
|
||||
{
|
||||
//Front -> Top -> Rear -> Bottom -> Front
|
||||
//m_cube->dump("TRACE - DPG::rotU before");
|
||||
m_cube->rotateUp();
|
||||
//m_cube->dump("TRACE - DPG::rotU after");
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
void DrawProjGroup::rotateDown()
|
||||
{
|
||||
//Front -> Bottom -> Rear -> Top -> Front
|
||||
m_cube->dump("TRACE - DPG::rotD before");
|
||||
m_cube->rotateDown();
|
||||
m_cube->dump("TRACE - DPG::rotD after");
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
void DrawProjGroup::spinCW()
|
||||
{
|
||||
//Top -> Right -> Bottom -> Left -> Top
|
||||
//m_cube->dump("TRACE - DPG::spinCW before");
|
||||
m_cube->spinCW();
|
||||
//m_cube->dump("TRACE - DPG::spinCW after");
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
void DrawProjGroup::spinCCW()
|
||||
{
|
||||
//Top -> Left -> Bottom -> Right -> Top
|
||||
//m_cube->dump("TRACE - DPG::spingCCW before");
|
||||
m_cube->spinCCW();
|
||||
//m_cube->dump("TRACE - DPG::spinCCW after");
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
// find a config with Dir as Front view and Up as Top view
|
||||
// used in setting view to match OpenInventor
|
||||
void DrawProjGroup::setTable(Base::Vector3d dir, Base::Vector3d up)
|
||||
{
|
||||
|
||||
std::string viewFront = Cube::dirToView(dir); //convert to closest basis vector
|
||||
std::string viewUp = Cube::dirToView(up); //convert to closest basis vector
|
||||
std::string viewUp = Cube::dirToView(up); //convert to closest basis vector
|
||||
std::string altKey = viewFront + viewUp;
|
||||
std::string config;
|
||||
Base::Console().Message("TRACE - DPG::setTable - using altKey: %s\n", altKey.c_str());
|
||||
try {
|
||||
config = m_frontTopToConfig.at(altKey);
|
||||
}
|
||||
// catch (const std::out_of_range& oor) {
|
||||
// std::cerr << "Out of Range error: " << oor.what() << '\n';
|
||||
// }
|
||||
catch (...) {
|
||||
Base::Console().Error("Error - DPG::setTable - no match for alt config: %s\n",altKey.c_str());
|
||||
catch (const std::out_of_range& oor) {
|
||||
Base::Console().Error("Error - DPG::setTable - no match for alt config: %s - %s\n",altKey.c_str(),oor.what());
|
||||
return;
|
||||
}
|
||||
Base::Console().Message("TRACE - DPG::setTable - found config: %s **\n",config.c_str());
|
||||
m_cube->updateDirsToConfig(config);
|
||||
m_cube->updateRotsToConfig(config);
|
||||
updateSecondaryDirs();
|
||||
setConfig(config);
|
||||
}
|
||||
|
||||
// set config to a specific value
|
||||
void DrawProjGroup::setConfig(std::string cfg)
|
||||
{
|
||||
m_cube->updateDirsToConfig(cfg);
|
||||
m_cube->updateRotsToConfig(cfg);
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
void DrawProjGroup::resetTable(void)
|
||||
@@ -988,56 +990,55 @@ void DrawProjGroup::resetTable(void)
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
//dumps the current iso DPGI's
|
||||
void DrawProjGroup::dumpISO(char * title)
|
||||
{
|
||||
//FBL/FBR/FTL/FTR
|
||||
//
|
||||
Base::Console().Message("DPG ISO: %s\n", title);
|
||||
for (auto& docObj: Views.getValues()) {
|
||||
Base::Vector3d dir;
|
||||
Base::Vector3d axis;
|
||||
DrawProjGroupItem* v = static_cast<DrawProjGroupItem*>(docObj);
|
||||
std::string t = v->Type.getValueAsString();
|
||||
dir = v->Direction.getValue();
|
||||
axis = v->OrientBasis.getValue();
|
||||
|
||||
|
||||
|
||||
Base::Console().Message("%s: %s/%s\n",
|
||||
t.c_str(),DrawUtil::formatVector(dir).c_str(),DrawUtil::formatVector(axis).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************
|
||||
//obs??
|
||||
//! rebuild view direction map from existing DPGI's if possible or from Anchor
|
||||
//! rebuild view direction map from existing DPGI's
|
||||
void DrawProjGroup::onDocumentRestored()
|
||||
{
|
||||
// Base::Vector3d f,r,t;
|
||||
// Base::Vector3d fr,rr,tr;
|
||||
// bool ffound = false;
|
||||
// bool rfound = false;
|
||||
// bool tfound = false;
|
||||
//
|
||||
// for (auto& docObj: Views.getValues()) {
|
||||
// DrawProjGroupItem* v = static_cast<DrawProjGroupItem*>(docObj);
|
||||
// ProjItemType type = static_cast<ProjItemType>(v->Type.getValue());
|
||||
// switch (type) {
|
||||
// case Front : {
|
||||
// f = v->Direction.getValue();
|
||||
// fr = v->OrientBasis.getValue();
|
||||
// ffound = true;
|
||||
// break;
|
||||
// }
|
||||
// case Right : {
|
||||
// r = v->Direction.getValue();
|
||||
// rr = v->OrientBasis.getValue();
|
||||
// rfound = true;
|
||||
// break;
|
||||
// }
|
||||
// case Top : {
|
||||
// t = v->Direction.getValue();
|
||||
// tr = v->OrientBasis.getValue();
|
||||
// tfound = true;
|
||||
// break;
|
||||
// }
|
||||
// default: {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (ffound && rfound && tfound) {
|
||||
// //m_cube->reinit(r,rr,f,fr,t,tr);
|
||||
// Base::Console().Log("LOG: - DPG::restore - found Right,Front,Top\n");
|
||||
// } else {
|
||||
// m_cube->initialize(r,f,t);
|
||||
// Base::Console().Log("LOG: - DPG::restore - didn't find Right,Front,Top\n");
|
||||
// }
|
||||
// DrawViewCollection::onDocumentRestored();
|
||||
if (hasProjection("Front") && hasProjection("Right")) {
|
||||
Base::Vector3d dirFront = getProjItem("Front")->Direction.getValue();
|
||||
std::string viewFront = Cube::dirToView(dirFront);
|
||||
Base::Vector3d dirRight = getProjItem("Right")->Direction.getValue();
|
||||
std::string viewRight = Cube::dirToView(dirRight);
|
||||
std::string config = viewFront + viewRight;
|
||||
setConfig(config);
|
||||
} else if (hasProjection("Front")) {
|
||||
Base::Vector3d dirFront = getProjItem("Front")->Direction.getValue();
|
||||
std::string viewDir = Cube::dirToView(dirFront);
|
||||
Base::Vector3d rotFront = getProjItem("Rot")->OrientBasis.getValue();
|
||||
std::string viewRot = Cube::dirToView(rotFront);
|
||||
std::string config = viewDir + viewRot;
|
||||
//find(config) or try/catch
|
||||
try {
|
||||
config = m_dirRotToConfig.at(config);
|
||||
setConfig(config);
|
||||
}
|
||||
catch (...) {
|
||||
Base::Console().Message("ERROR: DPG cannot set configuration: %s using AD\n",config.c_str());
|
||||
setConfig("AD");
|
||||
}
|
||||
} else {
|
||||
Base::Console().Message("ERROR: DPG cannot find Front view on restore\n");
|
||||
setConfig("AD"); // set to default config??
|
||||
}
|
||||
}
|
||||
|
||||
PyObject *DrawProjGroup::getPyObject(void)
|
||||
|
||||
Reference in New Issue
Block a user