Initial DrawingViewDetail

This commit is contained in:
WandererFan 2016-11-20 07:13:45 -05:00 committed by Yorik van Havre
parent 95768acf65
commit 906bffba8f
19 changed files with 1253 additions and 5 deletions

View File

@ -36,6 +36,7 @@
#include "DrawViewSpreadsheet.h"
#include "DrawViewMulti.h"
#include "DrawViewImage.h"
#include "DrawViewDetail.h"
namespace TechDraw {
extern PyObject* initModule();
@ -74,6 +75,9 @@ PyMODINIT_FUNC initTechDraw()
TechDraw::DrawViewDimension ::init();
TechDraw::DrawProjGroup ::init();
TechDraw::DrawProjGroupItem ::init();
TechDraw::DrawViewDetail ::init();
TechDraw::DrawTemplate ::init();
TechDraw::DrawParametricTemplate::init();
TechDraw::DrawSVGTemplate ::init();

View File

@ -82,7 +82,9 @@ SET(Draw_SRCS
DrawViewMulti.cpp
DrawViewMulti.h
DrawViewImage.cpp
DrawViewImage.h)
DrawViewImage.h
DrawViewDetail.cpp
DrawViewDetail.h)
SET(TechDraw_SRCS
AppTechDraw.cpp

View File

@ -37,6 +37,7 @@
#include <BRep_Tool.hxx>
#include <gp_Ax3.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
#include <BRepAdaptor_Curve.hxx>
@ -302,7 +303,32 @@ int DrawUtil::vectorCompare(const Base::Vector3d& v1, const Base::Vector3d& v2)
return result;
}
//!convert fromPoint in coordinate system fromSystem to reference coordinate system
Base::Vector3d DrawUtil::toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint)
{
gp_Pnt gFromPoint(fromPoint.x,fromPoint.y,fromPoint.z);
gp_Pnt gToPoint;
gp_Trsf T;
gp_Ax3 gRef;
gp_Ax3 gFrom(fromSystem);
T.SetTransformation (gFrom, gRef);
gToPoint = gFromPoint.Transformed(T);
Base::Vector3d toPoint(gToPoint.X(),gToPoint.Y(),gToPoint.Z());
return toPoint;
}
//! check if direction is parallel to stdZ
bool DrawUtil::checkZParallel(const Base::Vector3d direction)
{
bool result = false;
Base::Vector3d stdZ(0.0,0.0,1.0);
double dot = fabs(direction.Dot(stdZ));
double mag = direction.Length() * 1; //stdZ.Length() == 1
if (DrawUtil::fpCompare(dot,mag)) {
result = true;
}
return result;
}
//based on Function provided by Joe Dowsett, 2014
double DrawUtil::sensibleScale(double working_scale)

View File

@ -27,6 +27,8 @@
#include <QString>
#include <QByteArray>
#include <gp_Ax2.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
@ -57,6 +59,8 @@ class TechDrawExport DrawUtil {
static Base::Vector3d vertex2Vector(const TopoDS_Vertex& v);
static std::string formatVector(const Base::Vector3d& v);
static int vectorCompare(const Base::Vector3d& v1, const Base::Vector3d& v2);
static Base::Vector3d toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint);
static bool checkZParallel(const Base::Vector3d direction);
//debugging routines

View File

@ -0,0 +1,292 @@
/***************************************************************************
* Copyright (c) WandererFan (wandererfan@gmail.com) 2016 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <sstream>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepAdaptor_Surface.hxx>
# include <BRep_Builder.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrim_Cylinder.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepAlgoAPI_Common.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax3.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <gp_Dir.hxx>
#include <Geom_Plane.hxx>
#include <HLRBRep_Algo.hxx>
#include <HLRAlgo_Projector.hxx>
#include <HLRBRep_HLRToShape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Shell.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#endif
#include <chrono>
# include <QFile>
# include <QFileInfo>
#include <App/Application.h>
#include <App/Material.h>
#include <Base/BoundBox.h>
#include <Base/Exception.h>
#include <Base/Console.h>
#include <Base/Parameter.h>
#include <Mod/Part/App/PartFeature.h>
#include "Geometry.h"
#include "GeometryObject.h"
#include "EdgeWalker.h"
#include "DrawProjectSplit.h"
#include "DrawUtil.h"
#include "DrawViewDetail.h"
using namespace TechDraw;
using namespace std;
//===========================================================================
// DrawViewDetail
//===========================================================================
PROPERTY_SOURCE(TechDraw::DrawViewDetail, TechDraw::DrawViewPart)
DrawViewDetail::DrawViewDetail() :
m_mattingStyle(0)
{
static const char *dgroup = "Detail";
ADD_PROPERTY_TYPE(BaseView ,(0),dgroup,App::Prop_None,"2D View source for this Section");
ADD_PROPERTY_TYPE(AnchorPoint ,(0,0,0) ,dgroup,App::Prop_None,"Location of detail in BaseView");
ADD_PROPERTY_TYPE(Radius,(10.0),dgroup, App::Prop_None, "Size of detail area");
ADD_PROPERTY_TYPE(Reference ,("1"),dgroup,App::Prop_None,"An identifier for this detail");
getParameters();
}
DrawViewDetail::~DrawViewDetail()
{
}
short DrawViewDetail::mustExecute() const
{
short result = 0;
if (!isRestoring()) {
result = (AnchorPoint.isTouched() ||
Radius.isTouched() ||
BaseView.isTouched() ||
Reference.isTouched());
}
if (result) {
return result;
}
return TechDraw::DrawView::mustExecute();
}
void DrawViewDetail::onChanged(const App::Property* prop)
{
if (!isRestoring()) {
//Base::Console().Message("TRACE - DVD::onChanged(%s) - %s\n",prop->getName(),Label.getValue());
if (prop == &Reference) {
std::string lblText = "Detail " +
std::string(Reference.getValue());
Label.setValue(lblText);
}
}
DrawView::onChanged(prop);
}
App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
{
App::DocumentObject* link = Source.getValue();
App::DocumentObject* base = BaseView.getValue();
if (!link || !base) {
Base::Console().Log("INFO - DVD::execute - No Source or Link - creation?\n");
return DrawView::execute();
}
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
return new App::DocumentObjectExecReturn("Source object is not a Part object");
DrawViewPart* dvp = nullptr;
if (!base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) {
return new App::DocumentObjectExecReturn("BaseView object is not a DrawViewPart object");
} else {
dvp = static_cast<DrawViewPart*>(base);
}
//Base::Console().Message("TRACE - DVD::execute() - %s/%s\n",getNameInDocument(),Label.getValue());
const Part::TopoShape &partTopo = static_cast<Part::Feature*>(link)->Shape.getShape();
if (partTopo.getShape().IsNull())
return new App::DocumentObjectExecReturn("Linked shape object is empty");
(void) DrawView::execute(); //make sure Scale is up to date
Base::Vector3d anchor = AnchorPoint.getValue(); //this is a 2D point
anchor = Base::Vector3d(anchor.x,anchor.y, 0.0);
double radiusFudge = 1.1;
double radius = Radius.getValue() * radiusFudge;
Base::Vector3d dirDetail = dvp->Direction.getValue();
double scale = Scale.getValue();
gp_Ax2 viewAxis = TechDrawGeometry::getViewAxis(Base::Vector3d(0.0,0.0,0.0), dirDetail, false);
Base::BoundBox3d bbxSource = partTopo.getBoundBox();
BRepBuilderAPI_Copy BuilderCopy(partTopo.getShape());
TopoDS_Shape myShape = BuilderCopy.Shape();
gp_Pnt gpCenter = TechDrawGeometry::findCentroid(myShape,
dirDetail);
Base::Vector3d shapeCenter = Base::Vector3d(gpCenter.X(),gpCenter.Y(),gpCenter.Z());
double diag = bbxSource.CalcDiagonalLength();
Base::Vector3d extentFar,extentNear;
extentFar = shapeCenter + dirDetail * diag;
extentNear = shapeCenter + dirDetail * diag * -1.0;
//turn anchor(x,y,0) in projection plane(P) into displacement in 3D
Base::Vector3d offsetCenter3D = DrawUtil::toR3(viewAxis, anchor); //displacement in R3
if (DrawUtil::checkZParallel(dirDetail)) {
extentNear = extentNear + offsetCenter3D;
} else {
extentNear = extentNear - offsetCenter3D;
}
gp_Dir cylDir(dirDetail.x,dirDetail.y,dirDetail.z);
gp_Pnt cylPoint(extentNear.x,extentNear.y,extentNear.z);
gp_Ax2 cylAxis(cylPoint,cylDir);
BRepPrimAPI_MakeCylinder mkCyl(cylAxis, radius, (extentFar-extentNear).Length());
TopoDS_Shell sh = mkCyl.Cylinder().Shell();
BRepBuilderAPI_MakeSolid mkSol(sh);
TopoDS_Solid tool = mkSol.Solid();
BRepAlgoAPI_Common mkCommon(myShape,tool);
if (!mkCommon.IsDone()) {
Base::Console().Message("TRACE - DVD::execute - mkCommon not done\n");
return new App::DocumentObjectExecReturn("DVD::execute - mkCommon not done");
}
if (mkCommon.Shape().IsNull()) {
Base::Console().Message("TRACE - DVD::execute - mkCommon.Shape is Null\n");
return new App::DocumentObjectExecReturn("DVD::execute - mkCommon.Shape is Null");
}
//Did we get a solid?
TopExp_Explorer xp;
xp.Init(mkCommon.Shape(),TopAbs_SOLID);
if (!(xp.More() == Standard_True)) {
Base::Console().Message("TRACE - DVD::execute - mkCommon.Shape is not a solid!\n");
}
TopoDS_Shape detail = mkCommon.Shape();
Bnd_Box testBox;
testBox.SetGap(0.0);
BRepBndLib::Add(detail, testBox);
if (testBox.IsVoid()) {
Base::Console().Message("INFO - DVD::execute - testBox is void\n");
}
//for debugging show compound instead of cut
// BRep_Builder builder;
// TopoDS_Compound Comp;
// builder.MakeCompound(Comp);
// builder.Add(Comp, tool);
// builder.Add(Comp, myShape);
gp_Pnt inputCenter;
try {
inputCenter = TechDrawGeometry::findCentroid(detail,
Direction.getValue());
TopoDS_Shape mirroredShape = TechDrawGeometry::mirrorShape(detail,
inputCenter,
scale);
geometryObject = buildGeometryObject(mirroredShape,inputCenter);
#if MOD_TECHDRAW_HANDLE_FACES
if (handleFaces()) {
try {
extractFaces();
}
catch (Standard_Failure) {
Handle_Standard_Failure e4 = Standard_Failure::Caught();
Base::Console().Log("LOG - DVD::execute - extractFaces failed for %s - %s **\n",getNameInDocument(),e4->GetMessageString());
return new App::DocumentObjectExecReturn(e4->GetMessageString());
}
}
#endif //#if MOD_TECHDRAW_HANDLE_FACES
}
catch (Standard_Failure) {
Handle_Standard_Failure e1 = Standard_Failure::Caught();
Base::Console().Log("LOG - DVD::execute - base shape failed for %s - %s **\n",getNameInDocument(),e1->GetMessageString());
return new App::DocumentObjectExecReturn(e1->GetMessageString());
}
return App::DocumentObject::StdReturn;
}
void DrawViewDetail::getParameters()
{
// what parameters are useful?
// handleFaces
// radiusFudge?
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw");
m_mattingStyle = hGrp->GetInt("MattingStyle", 0);
}
// Python Drawing feature ---------------------------------------------------------
namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawViewDetailPython, TechDraw::DrawViewDetail)
template<> const char* TechDraw::DrawViewDetailPython::getViewProviderName(void) const {
return "TechDrawGui::ViewProviderViewPart";
}
/// @endcond
// explicit template instantiation
template class TechDrawExport FeaturePythonT<TechDraw::DrawViewDetail>;
}

View File

@ -0,0 +1,85 @@
/***************************************************************************
* Copyright (c) WandererFan (wandererfan@gmail.com) 2016 *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef _DrawViewDetail_h_
#define _DrawViewDetail_h_
#include <App/DocumentObject.h>
#include <App/PropertyLinks.h>
#include <App/PropertyFile.h>
#include <App/FeaturePython.h>
#include <App/Material.h>
#include <Base/Vector3D.h>
#include <TopoDS_Compound.hxx>
#include "DrawViewPart.h"
class gp_Pln;
class gp_Ax2;
class TopoDS_Face;
namespace TechDrawGeometry
{
class Face;
}
namespace TechDraw
{
class TechDrawExport DrawViewDetail : public DrawViewPart
{
PROPERTY_HEADER(Part::DrawViewDetail);
public:
/// Constructor
DrawViewDetail(void);
virtual ~DrawViewDetail();
App::PropertyLink BaseView;
App::PropertyVector AnchorPoint;
App::PropertyFloat Radius;
App::PropertyString Reference;
virtual short mustExecute() const;
virtual App::DocumentObjectExecReturn *execute(void);
virtual void onChanged(const App::Property* prop);
virtual const char* getViewProviderName(void) const {
return "TechDrawGui::ViewProviderViewPart";
}
public:
int getMattingStyle() const {return m_mattingStyle;}
protected:
Base::Vector3d toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint);
void getParameters(void);
int m_mattingStyle;
};
typedef App::FeaturePythonT<DrawViewDetail> DrawViewDetailPython;
} //namespace TechDraw
#endif

View File

@ -500,7 +500,7 @@ bool BSpline::isLine()
bool result = false;
BRepAdaptor_Curve c(occEdge);
Handle_Geom_BSplineCurve spline = c.BSpline();
if (spline->Degree() == 1) {
if (spline->NbPoles() == 2) {
result = true;
}
return result;

View File

@ -32,6 +32,7 @@
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <Geom_BSplineCurve.hxx>
#include <gp_Ax2.hxx>
#include <gp_Circ.hxx>
#include <gp_Dir.hxx>
@ -280,6 +281,7 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca
Base::Console().Log("INFO - GO::addGeomFromCompound - edge: %d is zeroEdge\n",i);
continue;
}
base = BaseGeom::baseFactory(edge);
if (base == nullptr) {
Base::Console().Message("Error - GO::addGeomFromCompound - baseFactory failed for edge: %d\n",i);

View File

@ -117,6 +117,8 @@ SET(TechDrawGuiView_SRCS
QGISVGTemplate.h
QGIVertex.cpp
QGIVertex.h
QGIMatting.cpp
QGIMatting.h
QGIDrawingTemplate.cpp
QGIDrawingTemplate.h
QGITemplate.cpp

View File

@ -64,6 +64,7 @@
#include <Mod/TechDraw/App/DrawViewSymbol.h>
#include <Mod/TechDraw/App/DrawViewDraft.h>
#include <Mod/TechDraw/App/DrawViewMulti.h>
#include <Mod/TechDraw/App/DrawViewDetail.h>
#include <Mod/TechDraw/Gui/QGVPage.h>
#include "DrawGuiUtil.h"
@ -375,6 +376,71 @@ bool CmdTechDrawNewViewSection::isActive(void)
return (havePage && haveView && !taskInProgress);
}
//===========================================================================
// TechDraw_NewViewDetail
//===========================================================================
DEF_STD_CMD_A(CmdTechDrawNewViewDetail);
CmdTechDrawNewViewDetail::CmdTechDrawNewViewDetail()
: Command("TechDraw_NewViewDetail")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert detail view in drawing");
sToolTipText = QT_TR_NOOP("Insert a new Detail View of a Part in the active drawing");
sWhatsThis = "TechDraw_NewViewDetail";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-viewdetail";
}
void CmdTechDrawNewViewDetail::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
if (!page) {
return;
}
std::vector<App::DocumentObject*> shapes = getSelection().getObjectsOfType(TechDraw::DrawViewPart::getClassTypeId());
if (shapes.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select at least 1 DrawingView object."));
return;
}
App::DocumentObject* dObj = *(shapes.begin());
TechDraw::DrawViewPart* dvp = static_cast<TechDraw::DrawViewPart*>(dObj);
std::string PageName = page->getNameInDocument();
Gui::WaitCursor wc;
openCommand("Create view");
std::string FeatName = getUniqueObjectName("Detail");
std::string SourceName = dvp->Source.getValue()->getNameInDocument();
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewDetail','%s')",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),SourceName.c_str());
doCommand(Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",FeatName.c_str(),(dObj)->getNameInDocument());
doCommand(Doc,"App.activeDocument().%s.Direction = App.activeDocument().%s.Direction",FeatName.c_str(),(dObj)->getNameInDocument());
doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str());
updateActive();
commitCommand();
}
bool CmdTechDrawNewViewDetail::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this);
bool taskInProgress = false;
if (havePage) {
taskInProgress = Gui::Control().activeDialog();
}
return (havePage && haveView && !taskInProgress);
}
//===========================================================================
// TechDraw_ProjGroup
//===========================================================================
@ -1010,6 +1076,7 @@ void CreateTechDrawCommands(void)
rcCmdMgr.addCommand(new CmdTechDrawNewPage());
rcCmdMgr.addCommand(new CmdTechDrawNewView());
rcCmdMgr.addCommand(new CmdTechDrawNewViewSection());
rcCmdMgr.addCommand(new CmdTechDrawNewViewDetail());
rcCmdMgr.addCommand(new CmdTechDrawNewMulti());
rcCmdMgr.addCommand(new CmdTechDrawProjGroup());
rcCmdMgr.addCommand(new CmdTechDrawAnnotation());

View File

@ -0,0 +1,124 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <assert.h>
//#include <QGraphicsScene>
//#include <QGraphicsSceneHoverEvent>
//#include <QMouseEvent>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#endif
#include <App/Application.h>
#include <App/Material.h>
#include <Base/Console.h>
#include <Base/Parameter.h>
#include <qmath.h>
#include <QRectF>
#include "QGCustomRect.h"
#include "ZVALUE.h"
#include "QGIMatting.h"
using namespace TechDrawGui;
QGIMatting::QGIMatting() :
m_height(10.0),
m_width(10.0),
m_holeStyle(0),
m_radius(5.0)
{
setCacheMode(QGraphicsItem::NoCache);
setAcceptHoverEvents(false);
setFlag(QGraphicsItem::ItemIsSelectable, false);
setFlag(QGraphicsItem::ItemIsMovable, false);
m_mat = new QGraphicsPathItem(); //QGIPrimPath??
addToGroup(m_mat);
m_border = new QGraphicsPathItem();
addToGroup(m_border);
m_pen.setColor(Qt::white);
m_brush.setColor(Qt::white);
m_brush.setStyle(Qt::SolidPattern);
// m_pen.setColor(Qt::black);
// m_pen.setStyle(Qt::DashLine);
// m_brush.setStyle(Qt::NoBrush);
m_penB.setColor(Qt::black);
m_brushB.setStyle(Qt::NoBrush);
m_mat->setPen(m_pen);
m_mat->setBrush(m_brush);
m_border->setPen(m_penB);
m_border->setBrush(m_brushB);
setZValue(ZVALUE::MATTING);
}
void QGIMatting::centerAt(QPointF centerPos)
{
QRectF box = boundingRect();
double width = box.width();
double height = box.height();
double newX = centerPos.x() - width/2.;
double newY = centerPos.y() - height/2.;
setPos(newX,newY);
}
void QGIMatting::centerAt(double cX, double cY)
{
QRectF box = boundingRect();
double width = box.width();
double height = box.height();
double newX = cX - width/2.;
double newY = cY - height/2.;
setPos(newX,newY);
}
void QGIMatting::draw()
{
QRectF outline(-m_width/2.0,-m_height/2.0,m_width,m_height);
QPainterPath ppOut;
ppOut.addRect(outline);
QPainterPath ppCut;
if (m_holeStyle == 0) {
QRectF roundCutout (-m_radius,-m_radius,2.0 * m_radius,2.0 * m_radius);
ppCut.addEllipse(roundCutout);
} else {
double squareSize = m_radius / 1.4142; //fit within radius
QRectF squareCutout (-squareSize,-squareSize,2.0 * squareSize,2.0 * squareSize);
ppCut.addRect(squareCutout);
}
ppOut.addPath(ppCut);
m_mat->setPath(ppOut);
m_border->setPath(ppCut);
}
void QGIMatting::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {
QStyleOptionGraphicsItem myOption(*option);
myOption.state &= ~QStyle::State_Selected;
QGraphicsItemGroup::paint (painter, &myOption, widget);
}

View File

@ -0,0 +1,82 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef DRAWINGGUI_QGIMATTING_H
#define DRAWINGGUI_QGIMATTING_H
#include <QGraphicsItem>
#include <QGraphicsItemGroup>
#include <QGraphicsRectItem>
#include <QGraphicsPathItem>
#include <QPainterPath>
#include <QPointF>
QT_BEGIN_NAMESPACE
class QPainter;
class QStyleOptionGraphicsItem;
QT_END_NAMESPACE
namespace TechDrawGui
{
class QGCustomRect;
class TechDrawGuiExport QGIMatting : public QGraphicsItemGroup
{
public:
explicit QGIMatting(void);
~QGIMatting() {}
enum {Type = QGraphicsItem::UserType + 205};
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void centerAt(QPointF centerPos);
virtual void centerAt(double cX, double cY);
virtual void setSize(double w, double h) {m_height = h; m_width = w;}
virtual void setHoleStyle(int hs) {m_holeStyle = hs;}
virtual void setRadius(double r) {m_radius = r;}
virtual void draw(void);
protected:
double m_height;
double m_width;
int m_holeStyle; //round or rect
double m_radius;
QGraphicsPathItem* m_mat;
QGraphicsPathItem* m_border;
// QPainterPath m_perimeter;
// QPainterPath m_cutout;
private:
QPen m_pen;
QBrush m_brush;
QPen m_penB;
QBrush m_brushB;
};
} // namespace MDIViewPageGui
#endif // DRAWINGGUI_QGIMATTING_H

View File

@ -37,6 +37,7 @@ QGICenterLine: 174
QGICaption: 180
QGIViewImage: 200
QGCustomImage: 201
QGIMatting: 205
*/
/*

View File

@ -51,6 +51,7 @@
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/DrawViewSection.h>
#include <Mod/TechDraw/App/DrawHatch.h>
#include <Mod/TechDraw/App/DrawViewDetail.h>
#include "ZVALUE.h"
#include "QGIFace.h"
@ -61,6 +62,8 @@
#include "QGICenterLine.h"
#include "QGCustomBorder.h"
#include "QGCustomLabel.h"
#include "QGCustomRect.h"
#include "QGIMatting.h"
#include "QGIViewPart.h"
using namespace TechDrawGui;
@ -308,6 +311,7 @@ void QGIViewPart::updateView(bool update)
void QGIViewPart::draw() {
drawViewPart();
drawBorder();
drawMatting();
}
void QGIViewPart::drawViewPart()
@ -486,11 +490,14 @@ void QGIViewPart::removeDecorations()
QList<QGraphicsItem*> children = childItems();
for (auto& c:children) {
QGIDecoration* decor = dynamic_cast<QGIDecoration*>(c);
QGIMatting* mat = dynamic_cast<QGIMatting*>(c);
if (decor) {
removeFromGroup(decor);
scene()->removeItem(decor);
delete decor;
} else if (mat) {
removeFromGroup(mat);
scene()->removeItem(mat);
delete mat;
}
}
}
@ -601,6 +608,29 @@ void QGIViewPart::drawCenterLines(bool b)
}
}
void QGIViewPart::drawMatting()
{
auto viewPart( dynamic_cast<TechDraw::DrawViewPart *>(getViewObject()) );
TechDraw::DrawViewDetail* dvd = nullptr;
if (viewPart->isDerivedFrom(TechDraw::DrawViewDetail::getClassTypeId())) {
dvd = static_cast<TechDraw::DrawViewDetail*>(viewPart);
} else {
return;
}
double scale = dvd->Scale.getValue();
double radius = dvd->Radius.getValue() * scale;
QGIMatting* mat = new QGIMatting();
addToGroup(mat);
mat->setPos(0.0,0.0);
mat->setRadius(radius);
QRectF displayArea = customChildrenBoundingRect();
mat->setSize(displayArea.width(),displayArea.height());
mat->setHoleStyle(dvd->getMattingStyle());
mat->draw();
mat->show();
}
// As called by arc of ellipse case:
// pathArc(path, geom->major, geom->minor, geom->angle, geom->largeArc, geom->cw,
// geom->endPnt.x, geom->endPnt.y,

View File

@ -60,6 +60,7 @@ public:
virtual QRectF boundingRect() const override;
virtual void drawSectionLine(TechDraw::DrawViewSection* s, bool b);
virtual void drawCenterLines(bool b);
virtual void drawMatting(void);
bool showSection;
virtual void draw() override;

View File

@ -48,6 +48,7 @@
<file>icons/actions/techdraw-projgroup.svg</file>
<file>icons/actions/techdraw-spreadsheet.svg</file>
<file>icons/actions/techdraw-image.svg</file>
<file>icons/actions/techdraw-viewdetail.svg</file>
<file>icons/actions/section-up.svg</file>
<file>icons/actions/section-down.svg</file>
<file>icons/actions/section-left.svg</file>

View File

@ -0,0 +1,521 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
width="48"
height="48"
id="svg249">
<defs
id="defs3">
<radialGradient
cx="605.71429"
cy="486.64789"
r="117.14286"
fx="605.71429"
fy="486.64789"
id="radialGradient5031"
xlink:href="#linearGradient5060"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)" />
<linearGradient
id="linearGradient5060">
<stop
id="stop5062"
style="stop-color:#000000;stop-opacity:1"
offset="0" />
<stop
id="stop5064"
style="stop-color:#000000;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
cx="605.71429"
cy="486.64789"
r="117.14286"
fx="605.71429"
fy="486.64789"
id="radialGradient5029"
xlink:href="#linearGradient5060"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)" />
<linearGradient
id="linearGradient5048">
<stop
id="stop5050"
style="stop-color:#000000;stop-opacity:0"
offset="0" />
<stop
id="stop5056"
style="stop-color:#000000;stop-opacity:1"
offset="0.5" />
<stop
id="stop5052"
style="stop-color:#000000;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="302.85715"
y1="366.64789"
x2="302.85715"
y2="609.50507"
id="linearGradient5027"
xlink:href="#linearGradient5048"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)" />
<linearGradient
id="linearGradient4542">
<stop
id="stop4544"
style="stop-color:#000000;stop-opacity:1"
offset="0" />
<stop
id="stop4546"
style="stop-color:#000000;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
cx="24.306795"
cy="42.07798"
r="15.821514"
fx="24.306795"
fy="42.07798"
id="radialGradient4548"
xlink:href="#linearGradient4542"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.284916,0,30.08928)" />
<linearGradient
id="linearGradient15662">
<stop
id="stop15664"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop15666"
style="stop-color:#f8f8f8;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
cx="20.892099"
cy="64.567902"
r="5.257"
fx="20.892099"
fy="64.567902"
id="aigrd3"
gradientUnits="userSpaceOnUse">
<stop
id="stop15573"
style="stop-color:#f0f0f0;stop-opacity:1"
offset="0" />
<stop
id="stop15575"
style="stop-color:#9a9a9a;stop-opacity:1"
offset="1" />
</radialGradient>
<radialGradient
cx="20.892099"
cy="114.5684"
r="5.256"
fx="20.892099"
fy="114.5684"
id="aigrd2"
gradientUnits="userSpaceOnUse">
<stop
id="stop15566"
style="stop-color:#f0f0f0;stop-opacity:1"
offset="0" />
<stop
id="stop15568"
style="stop-color:#9a9a9a;stop-opacity:1"
offset="1" />
</radialGradient>
<linearGradient
id="linearGradient269">
<stop
id="stop270"
style="stop-color:#a3a3a3;stop-opacity:1"
offset="0" />
<stop
id="stop271"
style="stop-color:#4c4c4c;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient259">
<stop
id="stop260"
style="stop-color:#fafafa;stop-opacity:1"
offset="0" />
<stop
id="stop261"
style="stop-color:#bbbbbb;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient12512">
<stop
id="stop12513"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop12517"
style="stop-color:#fff520;stop-opacity:0.89108908"
offset="0.5" />
<stop
id="stop12514"
style="stop-color:#fff300;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
cx="8.824419"
cy="3.7561285"
r="37.751713"
fx="8.824419"
fy="3.7561285"
id="radialGradient15656"
xlink:href="#linearGradient269"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.968273,0,0,1.032767,3.4281936,-47.492271)" />
<radialGradient
cx="33.966679"
cy="35.736916"
r="86.70845"
fx="33.966679"
fy="35.736916"
id="radialGradient15658"
xlink:href="#linearGradient259"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.960493,0,0,1.041132,0.07464063,-48.138718)" />
<radialGradient
cx="8.1435566"
cy="7.2678967"
r="38.158695"
fx="8.1435566"
fy="7.2678967"
id="radialGradient15668"
xlink:href="#linearGradient15662"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.968273,0,0,1.032767,3.4281936,-47.492271)" />
<radialGradient
cx="20.892099"
cy="114.5684"
r="5.256"
fx="20.892099"
fy="114.5684"
id="radialGradient2283"
xlink:href="#aigrd2"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.229703,0,0,0.229703,4.613529,3.979808)" />
<radialGradient
cx="20.892099"
cy="64.567902"
r="5.257"
fx="20.892099"
fy="64.567902"
id="radialGradient2285"
xlink:href="#aigrd3"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.229703,0,0,0.229703,4.613529,3.979808)" />
<linearGradient
x1="18.971846"
y1="14.452502"
x2="44.524982"
y2="41.792759"
id="linearGradient4343"
xlink:href="#linearGradient3377-76"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3377-76">
<stop
id="stop3379-5"
style="stop-color:#faff2b;stop-opacity:1"
offset="0" />
<stop
id="stop4345"
style="stop-color:#fcb915;stop-opacity:1"
offset="0.5" />
<stop
id="stop3381-7"
style="stop-color:#c68708;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="145.64697"
y1="79.160103"
x2="175.6825"
y2="108.75008"
id="linearGradient4349"
xlink:href="#linearGradient3377-76"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient4482">
<stop
id="stop4484"
style="stop-color:#faff2b;stop-opacity:1"
offset="0" />
<stop
id="stop4486"
style="stop-color:#fcb915;stop-opacity:1"
offset="0.5" />
<stop
id="stop4488"
style="stop-color:#c68708;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
cx="135.38333"
cy="97.369568"
r="19.467436"
fx="135.38333"
fy="97.369568"
id="radialGradient4351"
xlink:href="#linearGradient3377"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.97435,0.2250379,-0.4623105,2.0016728,48.487554,-127.99883)" />
<linearGradient
id="linearGradient3377">
<stop
id="stop3379"
style="stop-color:#faff2b;stop-opacity:1"
offset="0" />
<stop
id="stop3381"
style="stop-color:#ffaa00;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
cx="45.883327"
cy="28.869568"
r="19.467436"
fx="45.883327"
fy="28.869568"
id="radialGradient4353"
xlink:href="#linearGradient3377"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient4495">
<stop
id="stop4497"
style="stop-color:#faff2b;stop-opacity:1"
offset="0" />
<stop
id="stop4499"
style="stop-color:#ffaa00;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="18.971846"
y1="14.452502"
x2="44.524982"
y2="41.792759"
id="linearGradient3213"
xlink:href="#linearGradient3377-76"
gradientUnits="userSpaceOnUse" />
<linearGradient
x1="145.64697"
y1="79.160103"
x2="175.6825"
y2="108.75008"
id="linearGradient3215"
xlink:href="#linearGradient3377-76"
gradientUnits="userSpaceOnUse" />
<radialGradient
cx="135.38333"
cy="97.369568"
r="19.467436"
fx="135.38333"
fy="97.369568"
id="radialGradient3217"
xlink:href="#linearGradient3377"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.97435,0.2250379,-0.4623105,2.0016728,48.487554,-127.99883)" />
<radialGradient
cx="45.883327"
cy="28.869568"
r="19.467436"
fx="45.883327"
fy="28.869568"
id="radialGradient3219"
xlink:href="#linearGradient3377"
gradientUnits="userSpaceOnUse" />
</defs>
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Jakub Steiner</dc:title>
</cc:Agent>
</dc:creator>
<dc:source>http://jimmac.musichall.cz</dc:source>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
<cc:permits
rdf:resource="http://web.resource.org/cc/Reproduction" />
<cc:permits
rdf:resource="http://web.resource.org/cc/Distribution" />
<cc:requires
rdf:resource="http://web.resource.org/cc/Notice" />
<cc:requires
rdf:resource="http://web.resource.org/cc/Attribution" />
<cc:permits
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
<cc:requires
rdf:resource="http://web.resource.org/cc/ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer6">
<g
transform="matrix(0.02165152,0,0,0.01485743,43.0076,42.68539)"
id="g5022"
style="display:inline">
<rect
width="1339.6335"
height="478.35718"
x="-1559.2523"
y="-150.69685"
id="rect4173"
style="opacity:0.40206185;color:#000000;fill:url(#linearGradient5027);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" />
<path
d="m -219.61876,-150.68038 c 0,0 0,478.33079 0,478.33079 142.874166,0.90045 345.40022,-107.16966 345.40014,-239.196175 0,-132.026537 -159.436816,-239.134595 -345.40014,-239.134615 z"
id="path5058"
style="opacity:0.40206185;color:#000000;fill:url(#radialGradient5029);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" />
<path
d="m -1559.2523,-150.68038 c 0,0 0,478.33079 0,478.33079 -142.8742,0.90045 -345.4002,-107.16966 -345.4002,-239.196175 0,-132.026537 159.4368,-239.134595 345.4002,-239.134615 z"
id="path5018"
style="opacity:0.40206185;color:#000000;fill:url(#radialGradient5031);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" />
</g>
</g>
<g
id="layer1"
style="display:inline">
<rect
width="34.875"
height="40.920494"
rx="1.1490486"
ry="1.1490486"
x="6.6781936"
y="-44.492271"
transform="matrix(3.7443726e-4,0.9999999,-0.9999999,3.7443726e-4,0,0)"
id="rect15391"
style="color:#000000;fill:url(#radialGradient15658);fill-opacity:1;fill-rule:nonzero;stroke:url(#radialGradient15656);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block;overflow:visible" />
<rect
width="32.775887"
height="38.946384"
rx="0.14904857"
ry="0.14904857"
x="7.7406945"
y="-43.554771"
transform="matrix(3.7443726e-4,0.9999999,-0.9999999,3.7443726e-4,0,0)"
id="rect15660"
style="color:#000000;fill:none;stroke:url(#radialGradient15668);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block;overflow:visible" />
<g
transform="matrix(3.7443726e-4,0.9999999,-0.9999999,3.7443726e-4,48.176974,0.7030484)"
id="g2270">
<g
transform="matrix(0.229703,0,0,0.229703,4.967081,4.244972)"
id="g1440"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-miterlimit:4">
<radialGradient
cx="20.892099"
cy="114.5684"
r="5.256"
fx="20.892099"
fy="114.5684"
id="radialGradient1442"
gradientUnits="userSpaceOnUse">
<stop
id="stop1444"
style="stop-color:#f0f0f0;stop-opacity:1"
offset="0" />
<stop
id="stop1446"
style="stop-color:#474747;stop-opacity:1"
offset="1" />
</radialGradient>
<path
d="m 23.428,113.07 c 0,1.973 -1.6,3.572 -3.573,3.572 -1.974,0 -3.573,-1.6 -3.573,-3.572 0,-1.974 1.6,-3.573 3.573,-3.573 1.973,0 3.573,1.6 3.573,3.573 z"
id="path1448"
style="stroke:none" />
<radialGradient
cx="20.892099"
cy="64.567902"
r="5.257"
fx="20.892099"
fy="64.567902"
id="radialGradient1450"
gradientUnits="userSpaceOnUse">
<stop
id="stop1452"
style="stop-color:#f0f0f0;stop-opacity:1"
offset="0" />
<stop
id="stop1454"
style="stop-color:#474747;stop-opacity:1"
offset="1" />
</radialGradient>
<path
d="m 23.428,63.07 c 0,1.973 -1.6,3.573 -3.573,3.573 -1.974,0 -3.573,-1.6 -3.573,-3.573 0,-1.974 1.6,-3.573 3.573,-3.573 1.973,0 3.573,1.6 3.573,3.573 z"
id="path1456"
style="stroke:none" />
</g>
<path
d="m 9.9950109,29.952326 c 0,0.453204 -0.3675248,0.820499 -0.8207288,0.820499 -0.4534338,0 -0.8207289,-0.367524 -0.8207289,-0.820499 0,-0.453434 0.3675248,-0.820729 0.8207289,-0.820729 0.453204,0 0.8207288,0.367525 0.8207288,0.820729 z"
id="path15570"
style="fill:url(#radialGradient2283);fill-rule:nonzero;stroke:none" />
<path
d="m 9.9950109,18.467176 c 0,0.453204 -0.3675248,0.820729 -0.8207288,0.820729 -0.4534338,0 -0.8207289,-0.367525 -0.8207289,-0.820729 0,-0.453434 0.3675248,-0.820729 0.8207289,-0.820729 0.453204,0 0.8207288,0.367525 0.8207288,0.820729 z"
id="path15577"
style="fill:url(#radialGradient2285);fill-rule:nonzero;stroke:none" />
</g>
<path
d="M 42.648774,11.564395 4.7421847,11.578589"
id="path15672"
style="fill:none;stroke:#000000;stroke-width:0.98855311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.01754384" />
<path
d="M 43.122908,12.558495 5.105198,12.57273"
id="path15674"
style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.20467828" />
<g
transform="matrix(0.52063118,0,0,0.46073953,-57.909224,-20.597682)"
id="g3618">
<path
d="m 152.88222,77.612314 -19.81441,7.17921 30.49556,4.148871 0.42548,35.773095 16.10976,-10.59033 0.57587,-34.384848 -27.79226,-2.125998 z"
id="rect3522"
style="fill:url(#linearGradient3215);fill-opacity:1;fill-rule:evenodd;stroke:#7b5600;stroke-width:2.91421914;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
d="m 133.33785,84.998317 30.70884,3.365615 0,36.477188 -31.12383,-5.06478 0.41499,-34.778023 z"
id="rect3520"
style="fill:url(#radialGradient3217);fill-opacity:1;fill-rule:evenodd;stroke:#7b5600;stroke-width:2.91421914;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
d="m 163.81279,88.408895 16.72598,-8.4088"
id="path3536"
style="fill:url(#radialGradient3219);fill-opacity:1;fill-rule:evenodd;stroke:#7b5600;stroke-width:2.91421914;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
<path
d="m 20.691381,20.86525 a 6.171114,6.2618656 0 1 1 -12.3422284,0 6.171114,6.2618656 0 1 1 12.3422284,0 z"
transform="translate(-0.1815033,-0.54451005)"
id="path3221"
style="color:#000000;fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:4, 2;stroke-dashoffset:5.4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
<g
id="layer4"
style="display:inline" />
</svg>

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -66,6 +66,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
*draw << "TechDraw_NewMulti";
*draw << "TechDraw_ProjGroup";
*draw << "TechDraw_NewViewSection";
*draw << "TechDraw_NewViewDetail";
*draw << "TechDraw_Annotation";
*draw << "TechDraw_Symbol";
*draw << "TechDraw_Spreadsheet";
@ -101,6 +102,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
*views << "TechDraw_NewMulti";
*views << "TechDraw_ProjGroup";
*views << "TechDraw_NewViewSection";
*views << "TechDraw_NewViewDetail";
*views << "TechDraw_Annotation";
*views << "TechDraw_DraftView";
*views << "TechDraw_ArchView";
@ -150,6 +152,7 @@ Gui::ToolBarItem* Workbench::setupCommandBars() const
*views << "TechDraw_NewMulti";
*views << "TechDraw_ProjGroup";
*views << "TechDraw_NewViewSection";
*views << "TechDraw_NewViewDetail";
*views << "TechDraw_Annotation";
*views << "TechDraw_DraftView";
*views << "TechDraw_Spreadsheet";

View File

@ -14,5 +14,6 @@ namespace ZVALUE {
const int SECTIONHATCH = 66;
const int DIMENSION = 70;
const int SECTIONLINE = 80; //TODO: change to "DECORATION"? section lines, symmetry lines, etc?
const int MATTING = 100;
}
#endif