importSVG.svgHandler Class Reference

Public Member Functions

def applyTrans (self, sh)
 
def characters (self, content)
 
def endElement (self, name)
 
def format (self, obj)
 
def getMatrix (self, tr)
 
def startElement (self, name, attrs)
 
def translateVec (self, vec, mat)
 

Public Attributes

 col
 
 color
 
 count
 
 currentsymbol
 
 disableUnitScaling
 
 fill
 
 grouptransform
 
 lastdim
 
 lw
 
 style
 
 svgdpi
 
 symbols
 
 text
 
 transform
 
 viewbox
 
 width
 
 x
 
 y
 

Detailed Description

Parse SVG files and create FreeCAD objects.

Member Function Documentation

◆ applyTrans()

def importSVG.svgHandler.applyTrans (   self,
  sh 
)

◆ characters()

def importSVG.svgHandler.characters (   self,
  content 
)
Read characters from the given string.

References importSVG.svgHandler.currentsymbol, App::DynamicProperty::PropData.doc, App::RelabelDocumentExpressionVisitor.doc, App::LinkBaseExtension::PropInfo.doc, Py::PythonType.doc(), ExpressionCompleterModel::Info.doc, Gui::GraphvizView.doc, ItemInfo.doc, ItemInfo2.doc, importIFClegacy.IfcEntity.doc, draftguitools.gui_annotationstyleeditor.AnnotationStyleEditor.doc, draftguitools.gui_base.GuiCommandSimplest.doc, draftguitools.gui_base.GuiCommandBase.doc, draftguitools.gui_base_original.DraftTool.doc, drafttests.test_airfoildat.DraftAirfoilDAT.doc, drafttests.test_creation.DraftCreation.doc, drafttests.test_dwg.DraftDWG.doc, drafttests.test_dxf.DraftDXF.doc, drafttests.test_modification.DraftModification.doc, drafttests.test_oca.DraftOCA.doc, drafttests.test_pivy.DraftPivy.doc, drafttests.test_svg.DraftSVG.doc, WorkingPlane.Plane.doc, Import::ImportOCAF.doc, Import::ImportXCAF.doc, Import::ImportOCAFAssembly.doc, MeshPartGui::Mesh2ShapeGmsh::Private.doc, PartGui::SectionCut.doc, PartGui::FaceColors::Private.doc, PartDesignGui::ComboLinks.doc, Mod.PartDesign.WizardShaft.Shaft.Shaft.doc, Mod.PartDesign.WizardShaft.WizardShaft.TaskWizardShaft.doc, PathTests.TestCentroidPost.TestCentroidPost.doc, PathTests.TestGrblPost.TestGrblPost.doc, PathTests.TestLinuxCNCPost.TestLinuxCNCPost.doc, PathTests.TestMach3Mach4Post.TestMach3Mach4Post.doc, PathTests.TestPathAdaptive.TestPathAdaptive.doc, PathTests.TestPathDrillable.TestPathDrillable.doc, PathTests.TestPathHelix.TestPathHelix.doc, PathTests.TestPathHelpers.TestPathHelpers.doc, PathTests.TestPathPost.TestBuildPostList.doc, PathTests.TestPathPost.TestOutputNameSubstitution.doc, PathTests.TestPathPropertyBag.TestPathPropertyBag.doc, PathTests.TestPathSetupSheet.TestPathSetupSheet.doc, PathTests.TestPathStock.TestPathStock.doc, PathTests.TestPathToolController.TestPathToolController.doc, PathTests.TestPathUtil.TestPathUtil.doc, PathTests.TestRefactoredCentroidPost.TestRefactoredCentroidPost.doc, PathTests.TestRefactoredGrblPost.TestRefactoredGrblPost.doc, PathTests.TestRefactoredLinuxCNCPost.TestRefactoredLinuxCNCPost.doc, PathTests.TestRefactoredMach3Mach4Post.TestRefactoredMach3Mach4Post.doc, PathTests.TestRefactoredTestPost.TestRefactoredTestPost.doc, Sandbox::CustomAddObjectEvent.doc, Sandbox::CustomRemoveObjectEvent.doc, Sandbox::CustomRecomputeEvent.doc, Sandbox::DocumentSaverThread.doc, Mod.Show.SceneDetail.SceneDetail.doc, Mod.Show.SceneDetails.Camera.Camera.doc, Mod.Show.SceneDetails.ClipPlane.ClipPlane.doc, Mod.Show.SceneDetails.ObjectClipPlane.ObjectClipPlane.doc, Mod.Show.SceneDetails.Pickability.Pickability.doc, Mod.Show.SceneDetails.VProperty.VProperty.doc, TestSpreadsheet.SpreadsheetCases.doc, TestSpreadsheetGui.SpreadsheetGuiCases.doc, Commands.TemplatePyMod_Cmd2.doc, importSVG.svgHandler.fill, importSVG.svgHandler.grouptransform, importSVG.svgHandler.symbols, App::StringExpression.text, Gui::Action.text(), Gui::DAG::VertexProperty.text, Gui::Dialog::DlgCheckableMessageBox.text, Gui::Dialog::DlgParameterFind::Options.text, Gui::Flag.text, Gui::SequencerBarPrivate.text, Gui::SequencerDialogPrivate.text, EnumItem.text, Gui::SoRegPoint.text, Gui::ToolTip.text, Gui::LabelEditor.text, exportIFCHelper.SIUnitCreator.text, draftguitools.gui_shapestrings.ShapeString.text, draftguitools.gui_texts.Text.text, draftviewproviders.view_dimension.ViewProviderLinearDimension.text, draftviewproviders.view_dimension.ViewProviderAngularDimension.text, draftviewproviders.view_text.ViewProviderText.text, importSVG.svgHandler.text, PartGui::DimensionLinear.text, PartGui::DimensionAngular.text, PartGui::ThicknessWidget::Private.text, ColorPickerItem.text(), Mod.Test.unittestgui.ProgressBar.text, Web::ServerEvent.text, Base::ViewProjMethod.transform, ArchSite.Compass.transform, draftguitools.gui_trackers.archDimTracker.transform, importSVG.svgHandler.transform, lscmrelax::LscmRelax.transform(), Part::Geometry.transform(), Sketcher::ExternalGeometryFacade.transform(), Sketcher::GeometryFacade.transform(), Path::Command.transform(), Base::CoordinateSystem.transform(), Base::Matrix4D.transform(), importSVG.svgHandler.translateVec(), e57::Translation.x, e57::Quaternion.x, R2.x, R3.x, uvPtStruct.x, XYZ.x, Base::DualQuat.x, Base::Vector2d.x, Base::Vector3< float >.x, Base::Vector3< double >.x, Base::Vector3< _Precision >.x, Gui::PropertyEditor::PropertyVectorItem.x, Gui::PropertyEditor::PropertyVectorDistanceItem.x, Gui::SelectionChanges.x, Gui::SelectionSingleton::SelObj.x, Gui::SelectionSingleton::_SelObj.x, Gui::DockWnd::SelectionView.x, DraftGui.DraftToolBar.x, importSVG.svgHandler.x, DrawingGui::orthoview.x, ap203_configuration_controlled_3d_design_of_mechanical_parts_and_assemblies_mim_lf.right_angular_wedge.x, ap203_configuration_controlled_3d_design_of_mechanical_parts_and_assemblies_mim_lf.block.x, automotive_design.right_angular_wedge.x, automotive_design.block.x, point3D.x, MeshCore::MeshFastBuilder::Private::Vertex.x, MeshCore::MeshGridIterator::GridElement.x, MeshCore::NODE.x, MeshPart::Vertex.x, MeshPartGui::MeshCrossSection.x, Part::MeshVertex.x, PartGui::DimSelections::DimSelection.x, Mod.PartDesign.Scripts.FilletArc.Vector.x, rotation_generator.refAxis.x, geoff_geometry::Point.x, geoff_geometry::Point3d.x, Point.x, PathScripts.PathDressupHoldingTags.Tag.x, Point3D.x, Plot.Line.x, Points::PointsGridIterator::GridElement.x, TechDraw::Vertex.x(), KDL::Vector.x(), KDL::Vector2.x(), geoff_geometry::SpanVertex.x, Param.x, GCS::Point.x, GCS::DeriVector2.x, e57::Translation.y, e57::Quaternion.y, R2.y, R3.y, uvPtStruct.y, XYZ.y, Base::DualQuat.y, Base::Vector2d.y, Base::Vector3< _Precision >.y, Base::Vector3< float >.y, Base::Vector3< double >.y, Gui::PropertyEditor::PropertyVectorItem.y, Gui::PropertyEditor::PropertyVectorDistanceItem.y, Gui::SelectionChanges.y, Gui::SelectionSingleton::SelObj.y, Gui::SelectionSingleton::_SelObj.y, Gui::DockWnd::SelectionView.y, DraftGui.DraftToolBar.y, importSVG.svgHandler.y, DrawingGui::orthoview.y, ap203_configuration_controlled_3d_design_of_mechanical_parts_and_assemblies_mim_lf.right_angular_wedge.y, ap203_configuration_controlled_3d_design_of_mechanical_parts_and_assemblies_mim_lf.block.y, automotive_design.right_angular_wedge.y, automotive_design.block.y, point3D.y, MeshCore::MeshFastBuilder::Private::Vertex.y, MeshCore::MeshGridIterator::GridElement.y, MeshCore::NODE.y, MeshPart::Vertex.y, MeshPartGui::MeshCrossSection.y, Part::MeshVertex.y, PartGui::DimSelections::DimSelection.y, Mod.PartDesign.Scripts.FilletArc.Vector.y, rotation_generator.refAxis.y, geoff_geometry::Point.y, geoff_geometry::Point3d.y, geoff_geometry::SpanVertex.y, Point.y, PathScripts.PathDressupHoldingTags.Tag.y, Point3D.y, Plot.Line.y, Points::PointsGridIterator::GridElement.y, TechDraw::Vertex.y(), KDL::Vector.y(), KDL::Vector2.y(), Param.y, GCS::Point.y, and GCS::DeriVector2.y.

◆ endElement()

def importSVG.svgHandler.endElement (   self,
  name 
)
Finish processing the element indicated by the name.

Parameters
----------
name : str
    The name of the element

References importSVG.svgHandler.currentsymbol, App::DynamicProperty::PropData.doc, App::RelabelDocumentExpressionVisitor.doc, App::LinkBaseExtension::PropInfo.doc, Py::PythonType.doc(), ExpressionCompleterModel::Info.doc, Gui::GraphvizView.doc, ItemInfo.doc, ItemInfo2.doc, importIFClegacy.IfcEntity.doc, draftguitools.gui_annotationstyleeditor.AnnotationStyleEditor.doc, draftguitools.gui_base.GuiCommandSimplest.doc, draftguitools.gui_base.GuiCommandBase.doc, draftguitools.gui_base_original.DraftTool.doc, drafttests.test_airfoildat.DraftAirfoilDAT.doc, drafttests.test_creation.DraftCreation.doc, drafttests.test_dwg.DraftDWG.doc, drafttests.test_dxf.DraftDXF.doc, drafttests.test_modification.DraftModification.doc, drafttests.test_oca.DraftOCA.doc, drafttests.test_pivy.DraftPivy.doc, drafttests.test_svg.DraftSVG.doc, WorkingPlane.Plane.doc, Import::ImportOCAF.doc, Import::ImportXCAF.doc, Import::ImportOCAFAssembly.doc, MeshPartGui::Mesh2ShapeGmsh::Private.doc, PartGui::SectionCut.doc, PartGui::FaceColors::Private.doc, PartDesignGui::ComboLinks.doc, Mod.PartDesign.WizardShaft.Shaft.Shaft.doc, Mod.PartDesign.WizardShaft.WizardShaft.TaskWizardShaft.doc, PathTests.TestCentroidPost.TestCentroidPost.doc, PathTests.TestGrblPost.TestGrblPost.doc, PathTests.TestLinuxCNCPost.TestLinuxCNCPost.doc, PathTests.TestMach3Mach4Post.TestMach3Mach4Post.doc, PathTests.TestPathAdaptive.TestPathAdaptive.doc, PathTests.TestPathDrillable.TestPathDrillable.doc, PathTests.TestPathHelix.TestPathHelix.doc, PathTests.TestPathHelpers.TestPathHelpers.doc, PathTests.TestPathPost.TestBuildPostList.doc, PathTests.TestPathPost.TestOutputNameSubstitution.doc, PathTests.TestPathPropertyBag.TestPathPropertyBag.doc, PathTests.TestPathSetupSheet.TestPathSetupSheet.doc, PathTests.TestPathStock.TestPathStock.doc, PathTests.TestPathToolController.TestPathToolController.doc, PathTests.TestPathUtil.TestPathUtil.doc, PathTests.TestRefactoredCentroidPost.TestRefactoredCentroidPost.doc, PathTests.TestRefactoredGrblPost.TestRefactoredGrblPost.doc, PathTests.TestRefactoredLinuxCNCPost.TestRefactoredLinuxCNCPost.doc, PathTests.TestRefactoredMach3Mach4Post.TestRefactoredMach3Mach4Post.doc, PathTests.TestRefactoredTestPost.TestRefactoredTestPost.doc, Sandbox::CustomAddObjectEvent.doc, Sandbox::CustomRemoveObjectEvent.doc, Sandbox::CustomRecomputeEvent.doc, Sandbox::DocumentSaverThread.doc, Mod.Show.SceneDetail.SceneDetail.doc, Mod.Show.SceneDetails.Camera.Camera.doc, Mod.Show.SceneDetails.ClipPlane.ClipPlane.doc, Mod.Show.SceneDetails.ObjectClipPlane.ObjectClipPlane.doc, Mod.Show.SceneDetails.Pickability.Pickability.doc, Mod.Show.SceneDetails.VProperty.VProperty.doc, TestSpreadsheet.SpreadsheetCases.doc, TestSpreadsheetGui.SpreadsheetGuiCases.doc, Commands.TemplatePyMod_Cmd2.doc, importSVG.svgHandler.grouptransform, importSVG.svgHandler.symbols, App::StringExpression.text, Gui::Action.text(), Gui::DAG::VertexProperty.text, Gui::Dialog::DlgCheckableMessageBox.text, Gui::Dialog::DlgParameterFind::Options.text, Gui::Flag.text, Gui::SequencerBarPrivate.text, Gui::SequencerDialogPrivate.text, EnumItem.text, Gui::SoRegPoint.text, Gui::ToolTip.text, Gui::LabelEditor.text, exportIFCHelper.SIUnitCreator.text, draftguitools.gui_shapestrings.ShapeString.text, draftguitools.gui_texts.Text.text, draftviewproviders.view_dimension.ViewProviderLinearDimension.text, draftviewproviders.view_dimension.ViewProviderAngularDimension.text, draftviewproviders.view_text.ViewProviderText.text, importSVG.svgHandler.text, PartGui::DimensionLinear.text, PartGui::DimensionAngular.text, PartGui::ThicknessWidget::Private.text, ColorPickerItem.text(), Mod.Test.unittestgui.ProgressBar.text, Web::ServerEvent.text, Base::ViewProjMethod.transform, importSVG.svgHandler.transform, Sketcher::ExternalGeometryFacade.transform(), Sketcher::GeometryFacade.transform(), Path::Command.transform(), Base::CoordinateSystem.transform(), ArchSite.Compass.transform, lscmrelax::LscmRelax.transform(), Part::Geometry.transform(), Base::Matrix4D.transform(), and draftguitools.gui_trackers.archDimTracker.transform.

◆ format()

def importSVG.svgHandler.format (   self,
  obj 
)
Apply styles to the object if the graphical interface is up.

References UNV2411::TRecord.color, UNV2412::TRecord.color, Gui::SoRegPoint.color, Gui::RDragger.color, Gui::SyntaxHighlighter.color(), Gui::ColorButton.color, ArchPanel.ViewProviderPanelCut.color, ArchPanel.ViewProviderPanelSheet.color, ArchSite._ViewProviderSite.color, ArchSpace._ViewProviderSpace.color, DraftGui.DraftToolBar.color, draftguitools.gui_trackers.Tracker.color, draftguitools.gui_trackers.editTracker.color, draftguitools.gui_trimex.Trimex.color, draftviewproviders.view_dimension.ViewProviderLinearDimension.color, draftviewproviders.view_dimension.ViewProviderAngularDimension.color, importSVG.svgHandler.color, PathScripts.PathDressupDogbone.Marker.color(), PathScripts.PathDressupTagGui.HoldingTagMarker.color, ColorPickerItem.color(), ColorPickerPopup.color(), QtColorPicker.color(), TechDraw::CosmeticVertex.color, TechDrawGui::lineAttributes.color, FeaturePython.ViewProviderOctahedron.color, Mod.Test.unittestgui.ProgressBar.color, importSVG.svgHandler.fill, Gui::GLPainter.width, SoVectorizeLine.width, ArchGrid.ArchGridTaskPanel.width, draftguitools.gui_trackers.boxTracker.width(), draftguitools.gui_trimex.Trimex.width, importSVG.svgHandler.width, DrawingGui::OrthoViews.width, ifc2x3.ifcpixeltexture.width, ifc2x3.ifccshapeprofiledef.width, ifc2x3.ifclshapeprofiledef.width, ifc2x3.ifcchamferedgefeature.width, ifc4.ifcpixeltexture.width, ifc4.ifccshapeprofiledef.width, ifc4.ifclshapeprofiledef.width, PathScripts.PathDressupHoldingTags.Tag.width, PathScripts.PathDressupTag.TagSolid.width, PathScripts.PathStock.StockFromBase.width, Points::Reader.width, Points::Writer.width, Reen::ImageTriangulation.width, and TechDrawGui::lineAttributes.width.

◆ getMatrix()

def importSVG.svgHandler.getMatrix (   self,
  tr 
)
Return a FreeCAD matrix from an SVG transform attribute.

Parameters
----------
tr : str
    The type of transform: 'matrix', 'translate', 'scale',
    'rotate', 'skewX', 'skewY' and its value

Returns
-------
Base::Matrix4D
    The translated matrix.

◆ startElement()

def importSVG.svgHandler.startElement (   self,
  name,
  attrs 
)

◆ translateVec()

def importSVG.svgHandler.translateVec (   self,
  vec,
  mat 
)
Translate (move) a point or vector by a matrix.

Parameters
----------
vec : Base::Vector3
    The original vector
mat : Base::Matrix4D
    The translation matrix, from which only the elements 14, 24, 34
    are used.

Referenced by importSVG.svgHandler.characters().

Member Data Documentation

◆ col

importSVG.svgHandler.col

◆ color

◆ count

◆ currentsymbol

importSVG.svgHandler.currentsymbol

◆ disableUnitScaling

importSVG.svgHandler.disableUnitScaling

◆ fill

importSVG.svgHandler.fill

◆ grouptransform

◆ lastdim

importSVG.svgHandler.lastdim

◆ lw

importSVG.svgHandler.lw

◆ style

importSVG.svgHandler.style

◆ svgdpi

importSVG.svgHandler.svgdpi

◆ symbols

importSVG.svgHandler.symbols

◆ text

◆ transform

◆ viewbox

importSVG.svgHandler.viewbox

◆ width

◆ x

◆ y


The documentation for this class was generated from the following file: