[TD]Edge and Vertex center lines

This commit is contained in:
wandererfan
2019-07-11 13:20:01 -04:00
committed by WandererFan
parent 23658da79a
commit a4577a1e5b
16 changed files with 1515 additions and 406 deletions

View File

@@ -96,25 +96,6 @@ std::string LineFormat::toString(void) const
return ss.str();
}
//bool LineFormat::fromCSV(std::string& lineSpec)
//{
// unsigned int maxCells = 4;
// if (lineSpec.length() == 0) {
// Base::Console().Message( "LineFormat::fromCSV - lineSpec empty\n");
// return false;
// }
// std::vector<std::string> values = DrawUtil::split(lineSpec);
// if (values.size() < maxCells) {
// Base::Console().Message( "LineFormat::fromCSV(%s) invalid CSV entry\n",lineSpec.c_str() );
// return false;
// }
// m_style = atoi(values[0].c_str());
// m_weight= atof(values[1].c_str());
// m_color.fromHexString(values[2]);
// m_visible = atoi(values[3].c_str());
// return true;
//}
//static preference getters.
double LineFormat::getDefEdgeWidth()
{
@@ -203,30 +184,6 @@ std::string CosmeticVertex::toString(void) const
return ss.str();
}
//bool CosmeticVertex::fromCSV(std::string& lineSpec)
//{
// unsigned int maxCells = 8;
// if (lineSpec.length() == 0) {
// Base::Console().Message( "CosmeticVertex::fromCSV - lineSpec empty\n");
// return false;
// }
// std::vector<std::string> values = DrawUtil::split(lineSpec);
// if (values.size() < maxCells) {
// Base::Console().Message( "CosmeticVertex::fromCSV(%s) invalid CSV entry\n",lineSpec.c_str() );
// return false;
// }
// double x = atof(values[0].c_str());
// double y = atof(values[1].c_str());
// double z = atof(values[2].c_str());
// point(Base::Vector3d (x,y,z));
// linkGeom = atoi(values[3].c_str());
// color.fromHexString(values[4]);
// size = atof(values[5].c_str());
// style = atoi(values[6].c_str());
// visible = atoi(values[7].c_str());
// return true;
//}
// Persistence implementers
unsigned int CosmeticVertex::getMemSize (void) const
{
@@ -373,71 +330,6 @@ std::string CosmeticEdge::toString(void) const
return ss.str();
}
//bool CosmeticEdge::fromCSV(std::string& lineSpec)
//{
// std::vector<std::string> tokens = DrawUtil::tokenize(lineSpec);
// if (tokens.empty()) {
// Base::Console().Message("CosmeticEdge::fromCSV - tokenize failed - no tokens\n");
// return false;
// }
// if (tokens[0].length() == 0) {
// Base::Console().Message( "CosmeticEdge::fromCSV - token0 empty\n");
// return false;
// }
//
// std::vector<std::string> values = DrawUtil::split(tokens[0]);
// unsigned int maxCells = 1;
// if (values.size() < maxCells) {
// Base::Console().Message( "CosmeticEdge::fromCSV(%s) invalid CSV entry\n",lineSpec.c_str() );
// return false;
// }
// int geomType = atoi(values[0].c_str());
// int lastToken = 0;
// if (geomType == TechDraw::GeomType::GENERIC) {
// if (tokens.size() != 4) {
// Base::Console().Message("CE::fromCSV - wrong number of tokens\n");
// return false;
// }
// TechDraw::Generic* tempGeom = new TechDraw::Generic();
// tempGeom->fromCSV(tokens[1] + ",$$$," + tokens[2]);
// lastToken = 3;
// m_geometry = tempGeom;
// m_geometry->occEdge = GeometryUtils::edgeFromGeneric(tempGeom);
// } else if (geomType == TechDraw::GeomType::CIRCLE) {
// if (tokens.size() != 4) {
// Base::Console().Message("CE::fromCSV - wrong number of tokens\n");
// return false;
// }
// TechDraw::Circle* tempGeom = new TechDraw::Circle();
// tempGeom->fromCSV(tokens[1] + ",$$$," + tokens[2]);
// lastToken = 3;
// m_geometry = tempGeom;
// m_geometry->occEdge = GeometryUtils::edgeFromCircle(tempGeom);
// } else if (geomType == TechDraw::GeomType::ARCOFCIRCLE) {
// if (tokens.size() != 5) {
// Base::Console().Message("CE::fromCSV - wrong number of tokens\n");
// return false;
// }
// TechDraw::AOC* tempGeom = new TechDraw::AOC();
// tempGeom->fromCSV(tokens[1] + ",$$$," + tokens[2] + ",$$$," + tokens[3]);
// lastToken = 4;
// m_geometry = tempGeom;
// m_geometry->occEdge = GeometryUtils::edgeFromCircleArc(tempGeom);
// } else {
// Base::Console().Message("Cosmetic::fromCSV - unimplemented geomType: %d\n", geomType);
// return false;
// }
// m_format.fromCSV(tokens[lastToken]);
// m_geometry->classOfEdge = ecHARD;
// m_geometry->visible = true;
// m_geometry->cosmetic = true;
// return true;
//}
void CosmeticEdge::dump(char* title)
{
Base::Console().Message("CE::dump - %s \n",title);
@@ -543,6 +435,9 @@ CenterLine::CenterLine(void)
m_vShift = 0.0;
m_rotate = 0.0;
m_extendBy = 0.0;
m_type = 0;
m_flip2Line = false;
}
CenterLine::CenterLine(CenterLine* cl)
@@ -556,6 +451,10 @@ CenterLine::CenterLine(CenterLine* cl)
m_extendBy = cl->m_extendBy;
m_faces = cl->m_faces;
m_format = cl->m_format;
m_type = cl->m_type;
m_flip2Line = cl->m_flip2Line;
m_edges = cl->m_edges;
m_verts = cl->m_verts;
}
CenterLine::CenterLine(Base::Vector3d p1, Base::Vector3d p2)
@@ -567,6 +466,8 @@ CenterLine::CenterLine(Base::Vector3d p1, Base::Vector3d p2)
m_vShift = 0.0;
m_rotate = 0.0;
m_extendBy = 0.0;
m_type = 0;
m_flip2Line = false;
}
CenterLine::CenterLine(Base::Vector3d p1, Base::Vector3d p2,
@@ -583,7 +484,8 @@ CenterLine::CenterLine(Base::Vector3d p1, Base::Vector3d p2,
m_vShift = v;
m_rotate = r;
m_extendBy = x;
//m_faces = ??
m_type = 0;
m_flip2Line = false;
}
CenterLine::~CenterLine()
@@ -592,20 +494,36 @@ CenterLine::~CenterLine()
TechDraw::BaseGeom* CenterLine::scaledGeometry(TechDraw::DrawViewPart* partFeat)
{
// Base::Console().Message("CL::scaledGeometry() - m_type: %d\n", m_type);
double scale = partFeat->getScale();
if (m_faces.empty() ) {
Base::Console().Message("CL::scaledGeometry - no Faces!\n");
if (m_faces.empty() &&
m_edges.empty() &&
m_verts.empty() ) {
Base::Console().Message("CL::scaledGeometry - no geometry to scale!\n");
return nullptr;
}
std::pair<Base::Vector3d, Base::Vector3d> ends =
calcEndPoints(partFeat,
m_faces,
m_mode, m_extendBy,
m_hShift,m_vShift, m_rotate);
std::pair<Base::Vector3d, Base::Vector3d> ends;
if (m_type == 0) {
ends = calcEndPoints(partFeat,
m_faces,
m_mode, m_extendBy,
m_hShift,m_vShift, m_rotate);
} else if (m_type == 1) {
ends = calcEndPoints2Lines(partFeat,
m_edges,
m_mode,
m_extendBy,
m_hShift, m_vShift, m_rotate, m_flip2Line);
} else if (m_type == 2) {
ends = calcEndPoints2Points(partFeat,
m_verts,
m_mode,
m_extendBy,
m_hShift, m_vShift, m_rotate, m_flip2Line);
}
TechDraw::BaseGeom* newGeom = nullptr;
// Base::Vector3d p1 = DrawUtil::invertY(ends.first);
// Base::Vector3d p2 = DrawUtil::invertY(ends.second);
Base::Vector3d p1 = ends.first;
Base::Vector3d p2 = ends.second;
gp_Pnt gp1(p1.x,p1.y,p1.z);
@@ -630,9 +548,11 @@ std::string CenterLine::toString(void) const
m_end.y << "," <<
m_end.z << "," <<
m_mode << "," <<
m_type << "," <<
m_hShift << "," <<
m_vShift << "," <<
m_rotate << "," <<
m_flip2Line << "," <<
m_extendBy << "," <<
m_faces.size();
if (!m_faces.empty()) {
@@ -648,58 +568,17 @@ std::string CenterLine::toString(void) const
return clCSV + ",$$$," + fmtCSV;
}
//bool CenterLine::fromCSV(std::string& lineSpec)
//{
// if (lineSpec.length() == 0) {
// Base::Console().Message( "CenterLine::fromCSV - lineSpec empty\n");
// return false;
// }
//
// std::vector<std::string> tokens = DrawUtil::tokenize(lineSpec);
// if (tokens.size() != 2) {
// Base::Console().Message("CenterLine::fromCSV - tokenize failed - size: %d\n",tokens.size());
// }
// if (tokens[0].length() == 0) {
// Base::Console().Message( "CenterLine::fromCSV - token0 empty\n");
// return false;
// }
// std::vector<std::string> values = DrawUtil::split(tokens[0]);
//// variable length record, can't determine maxCells in advance.
// double x = atof(values[0].c_str());
// double y = atof(values[1].c_str());
// double z = atof(values[2].c_str());
// m_start = Base::Vector3d (x,y,z);
// x = atof(values[3].c_str());
// y = atof(values[4].c_str());
// z = atof(values[5].c_str());
// m_end = Base::Vector3d (x,y,z);
// m_mode = atoi(values[6].c_str());
// m_hShift = atof(values[7].c_str());
// m_vShift = atof(values[8].c_str());
// m_rotate = atof(values[9].c_str());
// m_extendBy = atof(values[10].c_str());
// int m_faceCount = atoi(values[11].c_str());
// int i = 0;
// for ( ; i < m_faceCount; i++ ) {
// m_faces.push_back(values[12 + i]);
// }
// m_format.fromCSV(tokens[1]);
// return true;
//}
void CenterLine::dump(char* title)
{
Base::Console().Message("CL::dump - %s \n",title);
Base::Console().Message("CL::dump - %s \n",toString().c_str());
}
//end points for face centerline
std::pair<Base::Vector3d, Base::Vector3d> CenterLine::calcEndPoints(DrawViewPart* partFeat,
std::vector<std::string> faceNames,
int vert, double ext,
double m_hShift, double m_vShift,
double hShift, double vShift,
double rotate)
{
std::pair<Base::Vector3d, Base::Vector3d> result;
@@ -712,8 +591,6 @@ std::pair<Base::Vector3d, Base::Vector3d> CenterLine::calcEndPoints(DrawViewPart
faceBox.SetGap(0.0);
double scale = partFeat->getScale();
double hss = m_hShift * scale;
double vss = m_vShift * scale;
for (auto& fn: faceNames) {
if (TechDraw::DrawUtil::getGeomTypeFromName(fn) != "Face") {
@@ -729,49 +606,260 @@ std::pair<Base::Vector3d, Base::Vector3d> CenterLine::calcEndPoints(DrawViewPart
}
}
if (faceBox.IsVoid()) {
Base::Console().Error("CL::calcEndPoints - faceBox is void!\n");
return result;
}
double Xmin,Ymin,Zmin,Xmax,Ymax,Zmax;
faceBox.Get(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
double Xspan = fabs(Xmax - Xmin);
Xspan = (Xspan / 2.0);
double Xmid = Xmin + fabs(Xmax - Xmin) / 2.0;
double Xmid = Xmin + Xspan;
double Yspan = fabs(Ymax - Ymin);
Yspan = (Yspan / 2.0);
double Ymid = Ymin + fabs(Ymax - Ymin) / 2.0;
double Ymid = Ymin + Yspan;
Base::Vector3d p1, p2;
if (vert == 0) { //vertical
Base::Vector3d top(Xmid + hss, (Ymid - Yspan - ext) + vss, 0.0);
Base::Vector3d bottom(Xmid + hss, (Ymid + Yspan + ext) + vss, 0.0);
p1 = top;
p2 = bottom;
p1 = Base::Vector3d(Xmid, Ymax, 0.0);
p2 = Base::Vector3d(Xmid, Ymin, 0.0);
} else if (vert == 1) { //horizontal
Base::Vector3d left((Xmid - Xspan - ext) + hss, Ymid + vss, 0.0);
Base::Vector3d right((Xmid + Xspan + ext) + hss, Ymid + vss, 0.0);
p1 = left;
p2 = right;
} else { //vert == 2 //aligned
Base::Console().Message("CL::calcEndPoints - aligned is not implemented yet\n");
Base::Vector3d top(Xmid + hss, (Ymid - Yspan - ext) + vss, 0.0);
Base::Vector3d bottom(Xmid + hss, (Ymid + Yspan + ext) + vss, 0.0);
p1 = top;
p2 = bottom;
p1 = Base::Vector3d(Xmin, Ymid, 0.0);
p2 = Base::Vector3d(Xmax,Ymid, 0.0);
} else { //vert == 2 //aligned, but aligned doesn't make sense for face(s) bbox
Base::Console().Message("CL::calcEndPoints - aligned is not applicable to Face center lines\n");
p1 = Base::Vector3d(Xmid, Ymax, 0.0);
p2 = Base::Vector3d(Xmid, Ymin, 0.0);
}
Base::Vector3d bbxCenter(Xmid, Ymid, 0.0);
Base::Vector3d mid = (p1 + p2) / 2.0;
//extend
Base::Vector3d clDir = p2 - p1;
clDir.Normalize();
p1 = p1 - (clDir * ext);
p2 = p2 + (clDir * ext);
//rotate
if (!DrawUtil::fpCompare(rotate, 0.0)) {
//rotate p1, p2 about bbxCenter
double cosTheta = cos(rotate * M_PI / 180.0);
double sinTheta = sin(rotate * M_PI / 180.0);
Base::Vector3d toOrg = p1 - bbxCenter;
//rotate p1, p2 about mid point
double revRotate = -rotate;
double cosTheta = cos(revRotate * M_PI / 180.0);
double sinTheta = sin(revRotate * M_PI / 180.0);
Base::Vector3d toOrg = p1 - mid;
double xRot = toOrg.x * cosTheta - toOrg.y * sinTheta;
double yRot = toOrg.y * cosTheta + toOrg.x * sinTheta;
p1 = Base::Vector3d(xRot, yRot, 0.0) + bbxCenter;
toOrg = p2 - bbxCenter;
p1 = Base::Vector3d(xRot, yRot, 0.0) + mid;
toOrg = p2 - mid;
xRot = toOrg.x * cosTheta - toOrg.y * sinTheta;
yRot = toOrg.y * cosTheta + toOrg.x * sinTheta;
p2 = Base::Vector3d(xRot, yRot, 0.0) + bbxCenter;
p2 = Base::Vector3d(xRot, yRot, 0.0) + mid;
}
//shift
if (!DrawUtil::fpCompare(hShift, 0.0)) {
double hss = hShift * scale;
p1.x = p1.x + hss;
p2.x = p2.x + hss;
}
if (!DrawUtil::fpCompare(vShift, 0.0)) {
double vss = vShift * scale;
p1.y = p1.y + vss;
p2.y = p2.y + vss;
}
result.first = p1 / scale;
result.second = p2 / scale;
return result;
}
std::pair<Base::Vector3d, Base::Vector3d> CenterLine::calcEndPoints2Lines(DrawViewPart* partFeat,
std::vector<std::string> edgeNames,
int mode, double ext,
double hShift, double vShift,
double rotate, bool flip)
{
// Base::Console().Message("CL::calc2Lines()\n");
std::pair<Base::Vector3d, Base::Vector3d> result;
if (edgeNames.empty()) {
Base::Console().Message("CL::calcEndPoints2Lines - no edges!\n");
return result;
}
double scale = partFeat->getScale();
std::vector<TechDraw::BaseGeom*> edges;
for (auto& en: edgeNames) {
if (TechDraw::DrawUtil::getGeomTypeFromName(en) != "Edge") {
continue;
}
int idx = TechDraw::DrawUtil::getIndexFromName(en);
TechDraw::BaseGeom* bg = partFeat->getGeomByIndex(idx);
edges.push_back(bg);
}
if (edges.size() != 2) {
Base::Console().Message("CL::calcEndPoints2Lines - wrong number of edges!\n");
return result;
}
Base::Vector3d l1p1 = edges.front()->getStartPoint();
Base::Vector3d l1p2 = edges.front()->getEndPoint();
Base::Vector3d l2p1 = edges.back()->getStartPoint();
Base::Vector3d l2p2 = edges.back()->getEndPoint();
if (flip) {
Base::Vector3d temp;
temp = l2p1;
l2p1 = l2p2;
l2p2 = temp;
}
Base::Vector3d p1 = (l1p1 + l2p1) / 2.0;
Base::Vector3d p2 = (l1p2 + l2p2) / 2.0;
Base::Vector3d mid = (p1 + p2) / 2.0;
if (mode == 0) { //Vertical
p1.x = mid.x;
p2.x = mid.x;
} else if (mode == 1) { //Horizontal
p1.y = mid.y;
p2.y = mid.y;
} else if (mode == 2) { //Aligned
// no op
}
//extend
Base::Vector3d clDir = p2 - p1;
clDir.Normalize();
p1 = p1 - (clDir * ext);
p2 = p2 + (clDir * ext);
//rotate
if (!DrawUtil::fpCompare(rotate, 0.0)) {
//rotate p1, p2 about mid
double revRotate = -rotate;
double cosTheta = cos(revRotate * M_PI / 180.0);
double sinTheta = sin(revRotate * M_PI / 180.0);
Base::Vector3d toOrg = p1 - mid;
double xRot = toOrg.x * cosTheta - toOrg.y * sinTheta;
double yRot = toOrg.y * cosTheta + toOrg.x * sinTheta;
p1 = Base::Vector3d(xRot, yRot, 0.0) + mid;
toOrg = p2 - mid;
xRot = toOrg.x * cosTheta - toOrg.y * sinTheta;
yRot = toOrg.y * cosTheta + toOrg.x * sinTheta;
p2 = Base::Vector3d(xRot, yRot, 0.0) + mid;
}
//shift
if (!DrawUtil::fpCompare(hShift, 0.0)) {
double hss = hShift * scale;
p1.x = p1.x + hss;
p2.x = p2.x + hss;
}
if (!DrawUtil::fpCompare(vShift, 0.0)) {
double vss = vShift * scale;
p1.y = p1.y + vss;
p2.y = p2.y + vss;
}
result.first = p1 / scale;
result.second = p2 / scale;
return result;
}
std::pair<Base::Vector3d, Base::Vector3d> CenterLine::calcEndPoints2Points(DrawViewPart* partFeat,
std::vector<std::string> vertNames,
int mode, double ext,
double hShift, double vShift,
double rotate, bool flip)
{
// Base::Console().Message("CL::calc2Points()\n");
std::pair<Base::Vector3d, Base::Vector3d> result;
if (vertNames.empty()) {
Base::Console().Message("CL::calcEndPoints2Points - no points!\n");
return result;
}
double scale = partFeat->getScale();
std::vector<TechDraw::Vertex*> points;
for (auto& vn: vertNames) {
if (TechDraw::DrawUtil::getGeomTypeFromName(vn) != "Vertex") {
continue;
}
int idx = TechDraw::DrawUtil::getIndexFromName(vn);
TechDraw::Vertex* v = partFeat->getProjVertexByIndex(idx);
points.push_back(v);
}
if (points.size() != 2) {
Base::Console().Message("CL::calcEndPoints2Points - wrong number of points!\n");
return result;
}
Base::Vector3d v1 = points.front()->point();
Base::Vector3d v2 = points.back()->point();
Base::Vector3d mid = (v1 + v2) / 2.0;
Base::Vector3d dir = v2 - v1;
double length = dir.Length();
dir.Normalize();
Base::Vector3d clDir(dir.y, -dir.x, dir.z);
Base::Vector3d p1 = mid + clDir * (length / 2.0);
Base::Vector3d p2 = mid - clDir * (length / 2.0);
if (flip) {
Base::Vector3d temp;
temp = p1;
p1 = p2;
p2 = temp;
}
if (mode == 0) { //Vertical
p1.x = mid.x;
p2.x = mid.x;
} else if (mode == 1) { //Horizontal
p1.y = mid.y;
p2.y = mid.y;
} else if (mode == 2) { //Aligned
// no op
}
//extend
p1 = p1 - (clDir * ext);
p2 = p2 + (clDir * ext);
//rotate
if (!DrawUtil::fpCompare(rotate, 0.0)) {
//rotate p1, p2 about mid
double revRotate = -rotate;
double cosTheta = cos(revRotate * M_PI / 180.0);
double sinTheta = sin(revRotate * M_PI / 180.0);
Base::Vector3d toOrg = p1 - mid;
double xRot = toOrg.x * cosTheta - toOrg.y * sinTheta;
double yRot = toOrg.y * cosTheta + toOrg.x * sinTheta;
p1 = Base::Vector3d(xRot, yRot, 0.0) + mid;
toOrg = p2 - mid;
xRot = toOrg.x * cosTheta - toOrg.y * sinTheta;
yRot = toOrg.y * cosTheta + toOrg.x * sinTheta;
p2 = Base::Vector3d(xRot, yRot, 0.0) + mid;
}
//shift
if (!DrawUtil::fpCompare(hShift, 0.0)) {
double hss = hShift * scale;
p1.x = p1.x + hss;
p2.x = p2.x + hss;
}
if (!DrawUtil::fpCompare(vShift, 0.0)) {
double vss = vShift * scale;
p1.y = p1.y + vss;
p2.y = p2.y + vss;
}
result.first = p1 / scale;
@@ -802,6 +890,8 @@ void CenterLine::Save(Base::Writer &writer) const
writer.Stream() << writer.ind() << "<VShift value=\"" << m_vShift <<"\"/>" << endl;
writer.Stream() << writer.ind() << "<Rotate value=\"" << m_rotate <<"\"/>" << endl;
writer.Stream() << writer.ind() << "<Extend value=\"" << m_extendBy <<"\"/>" << endl;
writer.Stream() << writer.ind() << "<Type value=\"" << m_type <<"\"/>" << endl;
writer.Stream() << writer.ind() << "<Flip value=\"" << m_flip2Line <<"\"/>" << endl;
writer.Stream()
<< writer.ind()
<< "<Faces "
@@ -818,6 +908,36 @@ void CenterLine::Save(Base::Writer &writer) const
writer.Stream() << writer.ind() << "</Faces>" << endl ;
writer.Stream()
<< writer.ind()
<< "<Edges "
<< "EdgeCount=\"" << m_edges.size() <<
"\">" << endl;
writer.incInd();
for (auto& e: m_edges) {
writer.Stream()
<< writer.ind()
<< "<Edge value=\"" << e <<"\"/>" << endl;
}
writer.decInd();
writer.Stream() << writer.ind() << "</Edges>" << endl ;
writer.Stream()
<< writer.ind()
<< "<Points "
<< "PointCount=\"" << m_verts.size() <<
"\">" << endl;
writer.incInd();
for (auto& p: m_verts) {
writer.Stream()
<< writer.ind()
<< "<Point value=\"" << p <<"\"/>" << endl;
}
writer.decInd();
writer.Stream() << writer.ind() << "</Points>" << endl ;
writer.Stream() << writer.ind() << "<Style value=\"" << m_format.m_style << "\"/>" << endl;
writer.Stream() << writer.ind() << "<Weight value=\"" << m_format.m_weight << "\"/>" << endl;
writer.Stream() << writer.ind() << "<Color value=\"" << m_format.m_color.asHexString() << "\"/>" << endl;
@@ -850,6 +970,10 @@ void CenterLine::Restore(Base::XMLReader &reader)
m_rotate = reader.getAttributeAsFloat("value");
reader.readElement("Extend");
m_extendBy = reader.getAttributeAsFloat("value");
reader.readElement("Type");
m_type = reader.getAttributeAsInteger("value");
reader.readElement("Flip");
m_flip2Line = (bool)reader.getAttributeAsInteger("value")==0?false:true;
reader.readElement("Faces");
int count = reader.getAttributeAsInteger("FaceCount");
@@ -862,6 +986,28 @@ void CenterLine::Restore(Base::XMLReader &reader)
}
reader.readEndElement("Faces");
reader.readElement("Edges");
count = reader.getAttributeAsInteger("EdgeCount");
i = 0;
for ( ; i < count; i++) {
reader.readElement("Edge");
std::string e = reader.getAttribute("value");
m_edges.push_back(e);
}
reader.readEndElement("Edges");
reader.readElement("Points");
count = reader.getAttributeAsInteger("PointCount");
i = 0;
for ( ; i < count; i++) {
reader.readElement("Point");
std::string p = reader.getAttribute("value");
m_verts.push_back(p);
}
reader.readEndElement("Points");
reader.readElement("Style");
m_format.m_style = reader.getAttributeAsInteger("value");
reader.readElement("Weight");
@@ -883,7 +1029,12 @@ CenterLine* CenterLine::copy(void) const
newCL->m_vShift = m_vShift;
newCL->m_rotate = m_rotate;
newCL->m_extendBy = m_extendBy;
newCL->m_type = m_type;
newCL->m_flip2Line = m_flip2Line;
newCL->m_faces = m_faces;
newCL->m_edges = m_edges;
newCL->m_verts = m_verts;
newCL->m_format.m_style = m_format.m_style;
newCL->m_format.m_weight = m_format.m_weight;
@@ -955,36 +1106,6 @@ std::string GeomFormat::toString(void) const
return ss.str();
}
//bool GeomFormat::fromCSV(std::string& lineSpec)
//{
// std::vector<std::string> tokens = DrawUtil::tokenize(lineSpec);
// if (tokens.empty()) {
// Base::Console().Message("GeomFormat::fromCSV - tokenize failed - no tokens\n");
// return false;
// }
// if (tokens[0].length() == 0) {
// Base::Console().Message( "GeomFormat::fromCSV - token0 empty\n");
// return false;
// }
// std::vector<std::string> values = DrawUtil::split(tokens[0]);
// unsigned int maxCells = 1;
// if (values.size() < maxCells) {
// Base::Console().Message( "GeomFormat::fromCSV(%s) invalid CSV entry\n",lineSpec.c_str() );
// return false;
// }
// m_geomIndex = atoi(values[0].c_str());
// int lastToken = 1;
// if (tokens.size() != 2) {
// Base::Console().Message("CE::fromCSV - wrong number of tokens\n");
// return false;
// }
// m_format.fromCSV(tokens[lastToken]);
// return true;
//}
// Persistence implementer
unsigned int GeomFormat::getMemSize (void) const
{

View File

@@ -163,17 +163,33 @@ public:
int vert, double ext,
double m_hShift, double m_vShift,
double rotate);
static std::pair<Base::Vector3d, Base::Vector3d> calcEndPoints2Lines(
TechDraw::DrawViewPart* partFeat,
std::vector<std::string> faceNames,
int vert, double ext,
double m_hShift, double m_vShift,
double rotate, bool flip);
static std::pair<Base::Vector3d, Base::Vector3d> calcEndPoints2Points(
TechDraw::DrawViewPart* partFeat,
std::vector<std::string> faceNames,
int vert, double ext,
double m_hShift, double m_vShift,
double rotate, bool flip);
void dump(char* title);
Base::Vector3d m_start;
Base::Vector3d m_end;
std::vector<std::string> m_faces;
std::vector<std::string> m_edges;
std::vector<std::string> m_verts;
int m_type; // 0 - face, 1 - 2 line, 2 - 2 point
int m_mode; // 0 - vert/ 1 - horiz/ 2 - aligned
double m_hShift;
double m_vShift;
double m_rotate;
double m_extendBy;
LineFormat m_format;
bool m_flip2Line;
protected:

View File

@@ -278,6 +278,7 @@ TopoDS_Shape DrawViewPart::getSourceShapeFused(void) const
App::DocumentObjectExecReturn *DrawViewPart::execute(void)
{
// Base::Console().Message("DVP::execute()\n");
if (!keepUpdated()) {
return App::DocumentObject::StdReturn;
}
@@ -696,7 +697,7 @@ std::vector<TechDraw::BaseGeom*> DrawViewPart::getFaceEdgesByIndex(int idx) cons
for (auto& g:w->geoms) {
if (g->cosmetic) {
//if g is cosmetic, we should skip it
Base::Console().Message("DVP::getFaceEdgesByIndex - found cosmetic edge\n");
Base::Console().Log("DVP::getFaceEdgesByIndex - found cosmetic edge\n");
} else {
result.push_back(g);
}
@@ -1214,7 +1215,7 @@ void DrawViewPart::addCosmeticEdgesToGeom(void)
for ( ; i < stop; i++) {
TechDraw::BaseGeom* scaledGeom = edges.at(i)->scaledGeometry(getScale());
if (scaledGeom == nullptr) {
Base::Console().Message("DVP::addCosmeticEdgesToGeom - scaledGeometry is null\n");
Base::Console().Error("DVP::addCosmeticEdgesToGeom - scaledGeometry is null\n");
continue;
}
// int idx =
@@ -1235,6 +1236,7 @@ void DrawViewPart::clearCenterLines(void)
int DrawViewPart::addCenterLine(CenterLine* cl)
{
// Base::Console().Message("DVP::addCL(cl)\n");
std::vector<CenterLine*> lines = CenterLines.getValues();
int newIdx = (int) lines.size();
lines.push_back(cl);
@@ -1311,13 +1313,14 @@ TechDraw::CenterLine* DrawViewPart::getCenterLineByGeom(int idx) const
//add the center lines to geometry Edges list
void DrawViewPart::addCenterLinesToGeom(void)
{
int i = 0;
// Base::Console().Message("DVP::addCenterLinesToGeom()\n");
int i = 0;
const std::vector<TechDraw::CenterLine*> lines = CenterLines.getValues();
int stop = (int) lines.size();
for ( ; i < stop; i++) {
TechDraw::BaseGeom* scaledGeom = lines.at(i)->scaledGeometry(this);
if (scaledGeom == nullptr) {
Base::Console().Message("DVP::addCenterLinesToGeom - scaledGeometry is null\n");
Base::Console().Error("DVP::addCenterLinesToGeom - scaledGeometry is null\n");
continue;
}
// int idx =

View File

@@ -136,7 +136,7 @@ public:
TechDraw::GeometryObject* getGeometryObject(void) const { return geometryObject; }
TechDraw::BaseGeom* getGeomByIndex(int idx) const; //get existing geom for edge idx in projection
TechDraw::Vertex* getProjVertexByIndex(int idx) const; //get existing geom for vertex idx in projection
TechDraw::Vertex* getProjVertexByIndex(int idx) const; //get existing geom for vertex idx in projection
std::vector<TechDraw::BaseGeom*> getFaceEdgesByIndex(int idx) const; //get edges for face idx in projection
virtual Base::BoundBox3d getBoundingBox() const;

View File

@@ -498,6 +498,7 @@ int GeometryObject::addCosmeticEdge(TechDraw::BaseGeom* base,
int GeometryObject::addCenterLine(TechDraw::BaseGeom* base,
int s, int si)
{
// Base::Console().Message("GO::addCenterLine()\n");
base->cosmetic = true;
base->source(s); //1-CosmeticEdge, 2-CenterLine
base->sourceIndex(si); //index into source;

View File

@@ -88,6 +88,7 @@ set(TechDrawGui_UIC_SRCS
TaskBalloon.ui
TaskCosVertex.ui
TaskCenterLine.ui
TaskCL2Lines.ui
TaskLineDecor.ui
TaskRestoreLines.ui
)
@@ -166,6 +167,7 @@ SET(TechDrawGui_SRCS
TaskLineDecor.cpp
TaskLineDecor.h
TaskRestoreLines.ui
TaskCL2Lines.ui
DrawGuiUtil.cpp
DrawGuiUtil.h
Rez.cpp
@@ -320,6 +322,7 @@ SET(TechDrawGuiTaskDlgs_SRCS
TaskCenterLine.ui
TaskLineDecor.ui
TaskRestoreLines.ui
TaskCL2Lines.ui
)
SOURCE_GROUP("TaskDialogs" FILES ${TechDrawGuiTaskDlgs_SRCS})

View File

@@ -74,6 +74,9 @@ bool _checkSelectionHatch(Gui::Command* cmd);
void execCosmeticVertex(Gui::Command* cmd);
void execMidpoints(Gui::Command* cmd);
void execQuadrant(Gui::Command* cmd);
void execCenterLine(Gui::Command* cmd);
void exec2LineCenterLine(Gui::Command* cmd);
void exec2PointCenterLine(Gui::Command* cmd);
//===========================================================================
@@ -187,6 +190,10 @@ bool CmdTechDrawRichAnno::isActive(void)
}
//===========================================================================
// CosmeticVertexGroup
//===========================================================================
DEF_STD_CMD_ACL(CmdTechDrawCosmeticVertexGrp);
CmdTechDrawCosmeticVertexGrp::CmdTechDrawCosmeticVertexGrp()
@@ -586,6 +593,109 @@ bool CmdTechDrawAnnotation::isActive(void)
return DrawGuiUtil::needPage(this);
}
//===========================================================================
// CenterLineGroup
//===========================================================================
DEF_STD_CMD_ACL(CmdTechDrawCenterLineGrp);
CmdTechDrawCenterLineGrp::CmdTechDrawCenterLineGrp()
: Command("TechDraw_CenterLineGrp")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert Center Line");
sToolTipText = QT_TR_NOOP("Insert Center Line");
sWhatsThis = "TechDraw_CenterLineGrp";
sStatusTip = sToolTipText;
// eType = ForEdit;
}
void CmdTechDrawCenterLineGrp::activated(int iMsg)
{
// Base::Console().Message("CMD::CenterLineGrp - activated(%d)\n", iMsg);
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
if (dlg != nullptr) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Task In Progress"),
QObject::tr("Close active task dialog and try again."));
return;
}
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(_pcAction);
pcAction->setIcon(pcAction->actions().at(iMsg)->icon());
switch(iMsg) {
case 0:
execCenterLine(this);
break;
case 1:
exec2LineCenterLine(this);
break;
case 2:
exec2PointCenterLine(this);
break;
default:
Base::Console().Message("CMD::CVGrp - invalid iMsg: %d\n",iMsg);
};
}
Gui::Action * CmdTechDrawCenterLineGrp::createAction(void)
{
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
pcAction->setDropDownMenu(true);
applyCommandData(this->className(), pcAction);
QAction* p1 = pcAction->addAction(QString());
p1->setIcon(Gui::BitmapFactory().iconFromTheme("actions/techdraw-facecenterline"));
p1->setObjectName(QString::fromLatin1("TechDraw_FaceCenterLine"));
p1->setWhatsThis(QString::fromLatin1("TechDraw_FaceCenterLine"));
QAction* p2 = pcAction->addAction(QString());
p2->setIcon(Gui::BitmapFactory().iconFromTheme("actions/techdraw-2linecenterline"));
p2->setObjectName(QString::fromLatin1("TechDraw_2LineCenterLine"));
p2->setWhatsThis(QString::fromLatin1("TechDraw_2LineCenterLine"));
QAction* p3 = pcAction->addAction(QString());
p3->setIcon(Gui::BitmapFactory().iconFromTheme("actions/techdraw-2pointcenterline"));
p3->setObjectName(QString::fromLatin1("TechDraw_2PointCenterLine"));
p3->setWhatsThis(QString::fromLatin1("TechDraw_2PointCenterLine"));
_pcAction = pcAction;
languageChange();
pcAction->setIcon(p1->icon());
int defaultId = 0;
pcAction->setProperty("defaultAction", QVariant(defaultId));
return pcAction;
}
void CmdTechDrawCenterLineGrp::languageChange()
{
Command::languageChange();
if (!_pcAction)
return;
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(_pcAction);
QList<QAction*> a = pcAction->actions();
QAction* arc1 = a[0];
arc1->setText(QApplication::translate("CmdTechDrawCenterLineGrp","Center Line"));
arc1->setToolTip(QApplication::translate("TechDraw_FaceCenterLine","Insert a CenterLine into a Face(s)"));
arc1->setStatusTip(arc1->toolTip());
QAction* arc2 = a[1];
arc2->setText(QApplication::translate("Cmd2LineCenterLine","2 Line CenterLine"));
arc2->setToolTip(QApplication::translate("TechDraw_2LineCenterLine","Insert CenterLine between 2 lines"));
arc2->setStatusTip(arc2->toolTip());
QAction* arc3 = a[2];
arc3->setText(QApplication::translate("Cmd2PointCenterLine","2 Point CenterLine"));
arc3->setToolTip(QApplication::translate("TechDraw_2PointCenterLine","Insert CenterLine between 2 points"));
arc3->setStatusTip(arc3->toolTip());
}
bool CmdTechDrawCenterLineGrp::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this, false);
return (havePage && haveView);
}
//===========================================================================
// TechDraw_Centerline
//===========================================================================
@@ -615,12 +725,24 @@ void CmdTechDrawFaceCenterLine::activated(int iMsg)
return;
}
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
execCenterLine(this);
}
bool CmdTechDrawFaceCenterLine::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this, false);
return (havePage && haveView);
}
void execCenterLine(Gui::Command* cmd)
{
TechDraw::DrawPage* page = DrawGuiUtil::findPage(cmd);
if (!page) {
return;
}
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
std::vector<Gui::SelectionObject> selection = cmd->getSelection().getSelectionEx();
TechDraw::DrawViewPart* baseFeat = nullptr;
if (!selection.empty()) {
baseFeat = dynamic_cast<TechDraw::DrawViewPart *>(selection[0].getObject());
@@ -688,13 +810,221 @@ void CmdTechDrawFaceCenterLine::activated(int iMsg)
}
}
bool CmdTechDrawFaceCenterLine::isActive(void)
//===========================================================================
// TechDraw_2LineCenterline
//===========================================================================
DEF_STD_CMD_A(CmdTechDraw2LineCenterLine);
CmdTechDraw2LineCenterLine::CmdTechDraw2LineCenterLine()
: Command("TechDraw_2LineCenterLine")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Add a centerline between 2 lines");
sToolTipText = sMenuText;
sWhatsThis = "TechDraw_2LineCenterLine";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-2linecenterline";
}
void CmdTechDraw2LineCenterLine::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
if (dlg != nullptr) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Task In Progress"),
QObject::tr("Close active task dialog and try again."));
return;
}
exec2LineCenterLine(this);
}
bool CmdTechDraw2LineCenterLine::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this, false);
return (havePage && haveView);
}
void exec2LineCenterLine(Gui::Command* cmd)
{
TechDraw::DrawPage* page = DrawGuiUtil::findPage(cmd);
if (!page) {
return;
}
std::vector<Gui::SelectionObject> selection = cmd->getSelection().getSelectionEx();
TechDraw::DrawViewPart* baseFeat = nullptr;
if (!selection.empty()) {
baseFeat = dynamic_cast<TechDraw::DrawViewPart *>(selection[0].getObject());
if( baseFeat == nullptr ) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("No base View in Selection."));
return;
}
} else {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("You must select a base View for the line."));
return;
}
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
for (; itSel != selection.end(); itSel++) {
if ((*itSel).getObject()->isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) {
baseFeat = static_cast<TechDraw::DrawViewPart*> ((*itSel).getObject());
SubNames = (*itSel).getSubNames();
}
}
std::vector<std::string> faceNames;
std::vector<std::string> edgeNames;
for (auto& s: SubNames) {
std::string geomType = DrawUtil::getGeomTypeFromName(s);
if (geomType == "Edge") {
edgeNames.push_back(s);
}
}
if (edgeNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("You must select 2 lines or an existing CenterLine."));
return;
}
if (!edgeNames.empty() && (edgeNames.size() == 2)) {
Gui::Control().showDialog(new TaskDlgCenterLine(baseFeat,
page,
edgeNames));
} else if (!edgeNames.empty() && (edgeNames.size() == 1)) {
std::string edgeName = edgeNames.front();
int geomIdx = DrawUtil::getIndexFromName(edgeName);
const std::vector<TechDraw::BaseGeom *> &geoms = baseFeat->getEdgeGeometry();
BaseGeom* bg = geoms.at(geomIdx);
int clIdx = bg->sourceIndex();
TechDraw::CenterLine* cl = baseFeat->getCenterLineByIndex(clIdx);
if (cl == nullptr) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("No CenterLine in selection."));
return;
} else {
Base::Console().Message("CMD::2LineCenter - show edit dialog here\n");
Gui::Control().showDialog(new TaskDlgCenterLine(baseFeat,
page,
edgeNames.front()));
}
} else if (edgeNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("No CenterLine in selection."));
return;
}
}
//===========================================================================
// TechDraw_2PointCenterline
//===========================================================================
DEF_STD_CMD_A(CmdTechDraw2PointCenterLine);
CmdTechDraw2PointCenterLine::CmdTechDraw2PointCenterLine()
: Command("TechDraw_2PointCenterLine")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Add a centerline between 2 points");
sToolTipText = sMenuText;
sWhatsThis = "TechDraw_2PointCenterLine";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-2pointcenterline";
}
void CmdTechDraw2PointCenterLine::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
if (dlg != nullptr) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Task In Progress"),
QObject::tr("Close active task dialog and try again."));
return;
}
exec2PointCenterLine(this);
}
bool CmdTechDraw2PointCenterLine::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this, false);
return (havePage && haveView);
}
void exec2PointCenterLine(Gui::Command* cmd)
{
TechDraw::DrawPage* page = DrawGuiUtil::findPage(cmd);
if (!page) {
return;
}
std::vector<Gui::SelectionObject> selection = cmd->getSelection().getSelectionEx();
TechDraw::DrawViewPart* baseFeat = nullptr;
if (!selection.empty()) {
baseFeat = dynamic_cast<TechDraw::DrawViewPart *>(selection[0].getObject());
if( baseFeat == nullptr ) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("No base View in Selection."));
return;
}
} else {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("You must select a base View for the line."));
return;
}
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
for (; itSel != selection.end(); itSel++) {
if ((*itSel).getObject()->isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) {
baseFeat = static_cast<TechDraw::DrawViewPart*> ((*itSel).getObject());
SubNames = (*itSel).getSubNames();
}
}
std::vector<std::string> edgeNames;
std::vector<std::string> vertexNames;
for (auto& s: SubNames) {
std::string geomType = DrawUtil::getGeomTypeFromName(s);
if (geomType == "Vertex") {
vertexNames.push_back(s);
} else if (geomType == "Edge") {
edgeNames.push_back(s);
}
}
if (vertexNames.empty() &&
edgeNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("You must select 2 Vertexes or an existing CenterLine."));
return;
}
if (!vertexNames.empty() && (vertexNames.size() == 2)) {
Gui::Control().showDialog(new TaskDlgCenterLine(baseFeat,
page,
vertexNames));
} else if (!edgeNames.empty() && (edgeNames.size() == 1)) {
Gui::Control().showDialog(new TaskDlgCenterLine(baseFeat,
page,
edgeNames.front()));
} else if (vertexNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("No CenterLine in selection."));
return;
}
}
//===========================================================================
// TechDraw_CosmeticEraser
//===========================================================================
@@ -864,7 +1194,7 @@ void CmdTechDrawDecorateLine::activated(int iMsg)
}
Gui::Control().showDialog(new TaskDlgLineDecor(baseFeat,
edgeNames));
edgeNames));
}
bool CmdTechDrawDecorateLine::isActive(void)
@@ -884,8 +1214,11 @@ void CreateTechDrawCommandsAnnotate(void)
rcCmdMgr.addCommand(new CmdTechDrawCosmeticVertex());
rcCmdMgr.addCommand(new CmdTechDrawMidpoints());
rcCmdMgr.addCommand(new CmdTechDrawQuadrant());
rcCmdMgr.addCommand(new CmdTechDrawAnnotation());
rcCmdMgr.addCommand(new CmdTechDrawCenterLineGrp());
rcCmdMgr.addCommand(new CmdTechDrawFaceCenterLine());
rcCmdMgr.addCommand(new CmdTechDraw2LineCenterLine());
rcCmdMgr.addCommand(new CmdTechDraw2PointCenterLine());
rcCmdMgr.addCommand(new CmdTechDrawAnnotation());
rcCmdMgr.addCommand(new CmdTechDrawCosmeticEraser());
rcCmdMgr.addCommand(new CmdTechDrawDecorateLine());
}

View File

@@ -67,6 +67,8 @@
<file>icons/actions/techdraw-midpoint.svg</file>
<file>icons/actions/techdraw-quadrant.svg</file>
<file>icons/actions/techdraw-facecenterline.svg</file>
<file>icons/actions/techdraw-2linecenterline.svg</file>
<file>icons/actions/techdraw-2pointcenterline.svg</file>
<file>icons/actions/techdraw-eraser.svg</file>
<file>icons/actions/techdraw-linedecor.svg</file>
<file>icons/actions/techdraw-facedecor.svg</file>
@@ -147,4 +149,4 @@
<file>translations/TechDraw_ar.qm</file>
<file>translations/TechDraw_vi.qm</file>
</qresource>
</RCC>
</RCC>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -30,8 +30,8 @@
id="namedview983"
showgrid="true"
inkscape:zoom="5.6789513"
inkscape:cx="34.789479"
inkscape:cy="32"
inkscape:cx="20.691663"
inkscape:cy="25.597028"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:window-maximized="1"
@@ -262,16 +262,6 @@
offset="1"
id="stop3840-5" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5062-3"
id="linearGradient5064"
x1="33.055637"
y1="43.596096"
x2="42.195377"
y2="57.417107"
gradientUnits="userSpaceOnUse"
gradientTransform="rotate(-18.319839,64.341466,-116.09907)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5062-3"
@@ -281,35 +271,29 @@
x2="59.806271"
y2="11.684036"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5062-3"
id="linearGradient1029"
gradientUnits="userSpaceOnUse"
x1="43.818283"
y1="11.684036"
x2="59.806271"
y2="11.684036"
gradientTransform="rotate(-18.319839,75.134275,-113.93787)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5062-3"
id="linearGradient1242"
gradientUnits="userSpaceOnUse"
gradientTransform="rotate(-18.319839,64.341466,-116.09907)"
x1="33.055637"
y1="43.596096"
x2="42.195377"
y2="57.417107" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1043-3"
id="linearGradient1045"
x1="46"
y1="-42"
x2="22"
y2="-18"
gradientUnits="userSpaceOnUse" />
id="linearGradient1278"
x1="52"
y1="44"
x2="8"
y2="20"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0.99999965,-0.9999994)" />
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter1334"
x="-0.0097777778"
width="1.0195556"
y="-0.015529412"
height="1.0310588">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.22"
id="feGaussianBlur1336" />
</filter>
</defs>
<metadata
id="metadata3090">
@@ -319,7 +303,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -336,121 +320,28 @@
id="g1002">
<g
id="g1010">
<rect
style="opacity:1;vector-effect:none;fill:#d3d7cf;fill-opacity:1;stroke:#000000;stroke-width:1.9993701;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.39999998;stroke-opacity:1"
id="rect2535"
width="52"
height="15"
x="60"
y="74" />
<g
id="g1246"
transform="translate(0.3521777,68.322473)">
<path
d="M 84.142492,9.234073 A 8.9934077,8.993818 71.700584 1 1 100.78988,16.046327 8.9934077,8.993818 71.700584 1 1 84.142492,9.234073 Z"
id="path4250-71"
style="fill:none;stroke:#2e2900;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
d="M 86,10 A 7.0000001,6.9999997 71.680161 1 1 98.956981,15.302507 7.0000001,6.9999997 71.680161 0 1 86,10 Z"
id="path4250-7-3"
style="fill:url(#linearGradient1029);fill-opacity:1;stroke:#729fcf;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
<g
id="g1070">
<circle
r="19.355036"
transform="scale(1,-1)"
cy="-32"
cx="32"
id="path1198"
style="opacity:1;vector-effect:none;fill:url(#linearGradient1045);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.39999998;stroke-opacity:1" />
id="g1370">
<rect
y="15.000001"
x="4.9999995"
height="34"
width="54"
id="rect411"
style="opacity:1;vector-effect:none;fill:url(#linearGradient1278);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter1334)" />
<g
id="g1224">
<circle
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.9993701;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.39999998;stroke-opacity:1"
id="path1218"
cx="24.25209"
cy="27.15662"
r="4"
inkscape:transform-center-x="14.263197"
inkscape:transform-center-y="-7.3957316" />
<circle
inkscape:transform-center-y="-7.3957316"
inkscape:transform-center-x="14.263197"
r="4"
cy="27.15662"
cx="39.74791"
id="circle1220"
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.9993701;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.39999998;stroke-opacity:1" />
</g>
<g
transform="translate(0.862146)"
id="g1278">
id="g388"
transform="translate(0.1279185,1.8720811)">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 20.954573,38.819295 C 24,42 23.78945,44.356958 32,44"
id="path1272"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
style="fill:none;fill-rule:evenodd;stroke:#d3d7cf;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:8, 4;stroke-dashoffset:0;stroke-opacity:1"
d="M 32.400348,3.4254362 V 61.358668"
id="path384"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path1274"
d="M 41.321135,38.819295 C 38.275708,42 38.486258,44.356958 30.275708,44"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
id="g1270">
<g
id="g1250"
transform="matrix(0.67006766,0,0,1.0078927,-29.992008,3.1156093)">
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path3061"
d="M 95.268588,52.743233 89.278656,53.090692 89.763499,5.5587242 95.75343,5.211266 Z"
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3063"
d="M 91.199765,51.672714 91.835679,6.7450525"
style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<g
id="g1258"
transform="translate(-26.030657)">
<g
transform="matrix(0.3970358,0,0,0.40847587,21.54725,36.613485)"
id="g1234">
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#2e2900;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4250-71-6"
d="M 83.558913,48.11046 A 8.9934088,8.9938191 71.700584 1 1 100.20631,54.922715 8.9934088,8.9938191 71.700584 1 1 83.558913,48.11046 Z" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient5064);fill-opacity:1;stroke:#729fcf;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4250-7-3-2"
d="M 85.416421,48.876388 A 7.0000001,6.9999997 71.680161 1 1 98.373402,54.178895 7.0000001,6.9999997 71.680161 0 1 85.416421,48.876388 Z" />
</g>
<g
id="g1240"
transform="matrix(0.3970358,0,0,0.40847587,21.552691,-14.908292)">
<path
d="M 83.558913,48.11046 A 8.9934088,8.9938191 71.700584 1 1 100.20631,54.922715 8.9934088,8.9938191 71.700584 1 1 83.558913,48.11046 Z"
id="path1236"
style="fill:none;stroke:#2e2900;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
d="M 85.416421,48.876388 A 7.0000001,6.9999997 71.680161 1 1 98.373402,54.178895 7.0000001,6.9999997 71.680161 0 1 85.416421,48.876388 Z"
id="path1238"
style="fill:url(#linearGradient1242);fill-opacity:1;stroke:#729fcf;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
</g>
id="path386"
d="M 31.343815,2.8971697 V 60.830401"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:8, 4;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::TaskCL2Lines</class>
<widget class="QWidget" name="TechDrawGui::TaskCL2Lines">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>247</width>
<height>65</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>2 Line Parameters</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="rbFlip">
<property name="text">
<string>Flip ends</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -54,6 +54,7 @@
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/Gui/ui_TaskCenterLine.h>
#include <Mod/TechDraw/Gui/ui_TaskCL2Lines.h>
#include "DrawGuiStd.h"
#include "QGVPage.h"
@@ -78,7 +79,11 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
m_partFeat(partFeat),
m_basePage(page),
m_createMode(false),
m_edgeName(edgeName)
m_edgeName(edgeName),
m_flipped(false),
m_type(0), //0 - Face, 1 - 2 Lines, 2 - 2 points
m_mode(0) //0 - vertical, 1 - horizontal, 2 - aligned
{
// Base::Console().Message("TCL::TCL() - edit mode\n");
ui->setupUi(this);
@@ -91,6 +96,9 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
if (m_cl == nullptr) { //checked by CommandAnnotate. Should never happen.
Base::Console().Message("TCL::TCL() - no centerline found\n");
}
m_type = m_cl->m_type;
m_flipped = m_cl->m_flip2Line;
m_mode = m_cl->m_mode;
setUiEdit();
}
@@ -103,7 +111,10 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
m_partFeat(partFeat),
m_basePage(page),
m_createMode(true),
m_subNames(subNames)
m_subNames(subNames),
m_flipped(false),
m_type(0), //0 - Face, 1 - 2 Lines, 2 - 2 points
m_mode(0) //0 - vertical, 1 - horizontal, 2 - aligned
{
// Base::Console().Message("TCL::TCL() - create mode\n");
if ( (m_basePage == nullptr) ||
@@ -114,7 +125,18 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
}
ui->setupUi(this);
std::string check = subNames.front();
std::string geomType = TechDraw::DrawUtil::getGeomTypeFromName(check);
if (geomType == "Face") {
m_type = 0;
} else if (geomType == "Edge") {
m_type = 1;
} else if (geomType == "Vertex") {
m_type = 2;
} else {
Base::Console().Error("TaskCenterLine - unknow geometry type: %s. Can not proceed.\n", geomType.c_str());
return;
}
setUiPrimary();
}
@@ -204,22 +226,43 @@ void TaskCenterLine::setUiEdit()
//******************************************************************************
void TaskCenterLine::createCenterLine(void)
{
// Base::Console().Message("TCL::createCenterLine()\n");
// Base::Console().Message("TCL::createCenterLine() - m_type: %d\n", m_type);
Gui::Command::openCommand("Create CenterLine");
bool vertical = false;
if (ui->rbVertical->isChecked()) {
vertical = true;
}
double hShift = ui->qsbHorizShift->rawValue();
double vShift = ui->qsbVertShift->rawValue();
double rotate = ui->dsbRotate->value();
double extendBy = ui->qsbExtend->rawValue();
std::pair<Base::Vector3d, Base::Vector3d> ends;
ends = TechDraw::CenterLine::calcEndPoints(m_partFeat,
if (ui->rbVertical->isChecked()) {
m_mode = 0;
vertical = true;
} else if (ui->rbHorizontal->isChecked()) {
m_mode = 1;
} else if (ui->rbAligned->isChecked()) {
m_mode =2;
}
if (m_type == 0) {
ends = TechDraw::CenterLine::calcEndPoints(m_partFeat,
m_subNames,
vertical,
extendBy,
hShift, vShift, rotate);
} else if (m_type == 1) {
ends = TechDraw::CenterLine::calcEndPoints2Lines(m_partFeat,
m_subNames,
vertical,
m_mode,
extendBy,
hShift, vShift, rotate);
hShift, vShift, rotate, m_flipped);
} else if (m_type == 2) {
ends = TechDraw::CenterLine::calcEndPoints2Points(m_partFeat,
m_subNames,
m_mode,
extendBy,
hShift, vShift, rotate, m_flipped);
}
TechDraw::CenterLine* cl = new TechDraw::CenterLine(ends.first, ends.second);
cl->m_start = ends.first;
cl->m_end = ends.second;
@@ -231,22 +274,26 @@ void TaskCenterLine::createCenterLine(void)
cl->m_format.m_style = ui->cboxStyle->currentIndex();
cl->m_format.m_visible = true;
if (ui->rbVertical->isChecked()) {
cl->m_mode = 0;
} else if (ui->rbHorizontal->isChecked()) {
cl->m_mode = 1;
} else if (ui->rbAligned->isChecked()) {
cl->m_mode = 2;
if (m_type == 0) {
cl->m_faces = m_subNames;
} else if (m_type == 1) {
cl->m_edges = m_subNames;
} else if (m_type == 2) {
cl->m_verts = m_subNames;
}
cl->m_faces = m_subNames;
cl->m_mode = m_mode;
cl->m_rotate = rotate;
cl->m_vShift = vShift;
cl->m_hShift = hShift;
cl->m_extendBy = extendBy;
cl->m_mode = m_mode;
cl->m_type = m_type;
cl->m_flip2Line = m_flipped;
m_partFeat->addCenterLine(cl);
// m_partFeat->requestPaint(); //if execute has not run, then CL will not be in Geoms.
m_partFeat->recomputeFeature();
Gui::Command::updateActive();
Gui::Command::commitCommand();
@@ -262,19 +309,28 @@ void TaskCenterLine::updateCenterLine(void)
m_cl->m_format.m_visible = true;
if (ui->rbVertical->isChecked()) {
m_cl->m_mode = 0;
m_mode = 0;
} else if (ui->rbHorizontal->isChecked()) {
m_cl->m_mode = 1;
m_mode = 1;
} else if (ui->rbAligned->isChecked()) {
m_cl->m_mode = 2;
m_mode =2;
}
m_cl->m_mode = m_mode;
// if (ui->rbVertical->isChecked()) {
// m_cl->m_mode = 0;
// } else if (ui->rbHorizontal->isChecked()) {
// m_cl->m_mode = 1;
// } else if (ui->rbAligned->isChecked()) {
// m_cl->m_mode = 2;
// }
m_cl->m_rotate = ui->dsbRotate->value();
m_cl->m_vShift = ui->qsbVertShift->rawValue();
m_cl->m_hShift = ui->qsbHorizShift->rawValue();
m_cl->m_extendBy = ui->qsbExtend->rawValue();
m_partFeat->replaceCenterLine(m_clIdx, m_cl);
m_partFeat->requestPaint(); //is requestPaint enough here?
// m_partFeat->recomputeFeature();
m_partFeat->requestPaint();
m_cl->m_type = m_type;
m_cl->m_flip2Line = m_flipped;
Gui::Command::updateActive();
Gui::Command::commitCommand();
@@ -329,6 +385,11 @@ double TaskCenterLine::getExtendBy(void)
return ext;
}
void TaskCenterLine::setFlipped(bool b)
{
m_flipped = b;
}
//******************************************************************************
bool TaskCenterLine::accept()
@@ -354,7 +415,7 @@ bool TaskCenterLine::reject()
if (getCreateMode() &&
(m_partFeat != nullptr) ) {
// Base::Console().Message("TCL::reject - credit Mode!!\n");
// Base::Console().Message("TCL::reject - create Mode!!\n");
//nothing to remove.
}
@@ -370,6 +431,51 @@ bool TaskCenterLine::reject()
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TaskCL2Lines::TaskCL2Lines(TechDrawGui::TaskCenterLine* tcl) :
ui(new Ui_TaskCL2Lines),
m_tcl(tcl)
{
ui->setupUi(this);
connect(ui->rbFlip, SIGNAL(toggled( bool )), this, SLOT(onFlipToggled( bool )));
initUi();
}
TaskCL2Lines::~TaskCL2Lines()
{
delete ui;
}
void TaskCL2Lines::initUi()
{
}
void TaskCL2Lines::onFlipToggled(bool b)
{
Base::Console().Message("TCL2L::onFlipToggled(%d)\n", b);
m_tcl->setFlipped(b);
}
bool TaskCL2Lines::accept()
{
Base::Console().Message("TCL2L::accept()\n");
return true;
}
bool TaskCL2Lines::reject()
{
Base::Console().Message("TCL2L::reject()\n");
return false;
}
void TaskCL2Lines::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -383,6 +489,18 @@ TaskDlgCenterLine::TaskDlgCenterLine(TechDraw::DrawViewPart* partFeat,
widget->windowTitle(), true, 0);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
cl2Lines = new TaskCL2Lines(widget);
linesBox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-2linecenterline"),
widget->windowTitle(), true, 0);
linesBox->groupLayout()->addWidget(cl2Lines);
Content.push_back(linesBox);
// cl2Points = new TaskCL2Points(widget);
// pointsBox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-2pointcenterline"),
// widget->windowTitle(), true, 0);
// pointsBox->groupLayout()->addWidget(cl2Lines);
// Content.push_back(pointsBox);
}
TaskDlgCenterLine::TaskDlgCenterLine(TechDraw::DrawViewPart* partFeat,
@@ -395,6 +513,18 @@ TaskDlgCenterLine::TaskDlgCenterLine(TechDraw::DrawViewPart* partFeat,
widget->windowTitle(), true, 0);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
cl2Lines = new TaskCL2Lines(widget);
linesBox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-2linecenterline"),
widget->windowTitle(), true, 0);
linesBox->groupLayout()->addWidget(cl2Lines);
Content.push_back(linesBox);
// cl2Points = new TaskCL2Points(widget);
// pointsBox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-2pointcenterline"),
// widget->windowTitle(), true, 0);
// pointsBox->groupLayout()->addWidget(cl2Lines);
// Content.push_back(pointsBox);
}
TaskDlgCenterLine::~TaskDlgCenterLine()

View File

@@ -28,7 +28,8 @@
#include <Gui/TaskView/TaskView.h>
#include <Gui/TaskView/TaskDialog.h>
/*#include <Mod/TechDraw/Gui/ui_TaskCenterLine.h>*/
#include <Mod/TechDraw/Gui/ui_TaskCenterLine.h>
#include <Mod/TechDraw/Gui/ui_TaskCL2Lines.h>
/*#include "QGTracker.h"*/
@@ -41,6 +42,7 @@
#define TRACKERSAVE 5
class Ui_TaskCenterLine;
class Ui_TaskCL2Lines;
namespace App {
class DocumentObject;
@@ -92,6 +94,7 @@ public:
void saveButtons(QPushButton* btnOK,
QPushButton* btnCancel);
void enableTaskButtons(bool b);
void setFlipped(bool b);
protected Q_SLOTS:
@@ -104,7 +107,12 @@ protected:
void setUiEdit(void);
void createCenterLine(void);
void create2Lines(void);
void create2Points(void);
void updateCenterLine(void);
void update2Lines(void);
void update2Points(void);
double getCenterWidth();
QColor getCenterColor();
@@ -128,8 +136,37 @@ private:
int m_geomIndex;
TechDraw::CenterLine* m_cl;
int m_clIdx;
bool m_flipped;
int m_type;
int m_mode;
};
class TaskCL2Lines : public QWidget
{
Q_OBJECT
public:
TaskCL2Lines(TaskCenterLine* tcl);
~TaskCL2Lines();
public:
virtual bool accept();
virtual bool reject();
protected Q_SLOTS:
void onFlipToggled(bool b);
protected:
void changeEvent(QEvent *e);
void initUi(void);
private:
Ui_TaskCL2Lines* ui;
TechDraw::DrawViewPart* m_partFeat;
TechDrawGui::TaskCenterLine* m_tcl;
};
class TaskDlgCenterLine : public Gui::TaskView::TaskDialog
{
Q_OBJECT
@@ -163,8 +200,12 @@ public:
protected:
private:
TaskCenterLine * widget;
TaskCenterLine* widget;
Gui::TaskView::TaskBox* taskbox;
TaskCL2Lines* cl2Lines;
Gui::TaskView::TaskBox* linesBox;
};
} //namespace TechDrawGui

View File

@@ -125,7 +125,7 @@
<item row="0" column="2">
<widget class="QRadioButton" name="rbAligned">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="toolTip">
<string>Option not implemented yet</string>

View File

@@ -93,6 +93,9 @@ Gui::MenuItem* Workbench::setupMenuBar() const
*draw << "TechDraw_CosmeticVertex";
*draw << "TechDraw_Midpoints";
*draw << "TechDraw_Quadrant";
*draw << "TechDraw_FaceCenterLine";
*draw << "TechDraw_2LineCenterLine";
*draw << "TechDraw_2PointCenterLine";
*draw << "TechDraw_CosmeticEraser";
*draw << "TechDraw_DecorateLine";
@@ -157,7 +160,10 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
*anno << "TechDraw_LeaderLine";
*anno << "TechDraw_RichAnno";
*anno << "TechDraw_CosmeticVertexGrp";
*anno << "TechDraw_FaceCenterLine";
*anno << "TechDraw_CenterLineGrp";
// *anno << "TechDraw_FaceCenterLine";
// *anno << "TechDraw_2LineCenterLine";
// *anno << "TechDraw_2PointCenterLine";
*anno << "TechDraw_CosmeticEraser";
*anno << "TechDraw_DecorateLine";
return root;
@@ -219,7 +225,10 @@ Gui::ToolBarItem* Workbench::setupCommandBars() const
*anno << "TechDraw_LeaderLine";
*anno << "TechDraw_RichAnno";
*anno << "TechDraw_CosmeticVertexGrp";
*anno << "TechDraw_FaceCenterLine";
*anno << "TechDraw_CenterLineGrp";
// *anno << "TechDraw_FaceCenterLine";
// *anno << "TechDraw_2LineCenterLine";
// *anno << "TechDraw_2PointCenterLine";
*anno << "TechDraw_CosmeticEraser";
*anno << "TechDraw_DecorateLine";