cad4tcl Architecture

This page provides an overview on the architecture of cad4tcl. For the current state please check the files in the cad4tcl-package.

Package Namespace: cad4tcl

file: cad4tcl.tcl
  • proc cad4tcl::new {w width height stageFormat stageScale stageBorder args}
  • proc cad4tcl::getReportDOC {}
  • proc cad4tcl::ObjectMethods {name method argList}
  • proc cad4tcl::characterList {}


Package Class-Diagram

The following diagramm gives an overview on the classes of cad4tcl. To handle tk::canvas also as tkpath you will see specialized classes like e.g. ItemInterface_Canvas or ItemInterface_PathCanvas as a realization of ItemInterface_Super:

..._Canvas ....... realization for tk::canvas
..._PathCanvas ... realization for tkpath

cad4tcl - class diagram

cad4tcl: class diagram



Package File Structure

The following structure shows the structure of the package cad4tcl.

cad4tcl
    ├───pkgIndex.tcl
    ├───cad4tcl.tcl
    ├───app
    │   ├───etc
    │   │   └───icon
    │   ├───simplifySVG
    │   └───viewSVG
    ├───etc
    │   └───cad4tcl.xml
    ├───font
    │   ├───m_iso8.shp
    │   └───m_txt8.shp
    ├───image
    │   └───iconClose.gif
    ├───lib
    │   ├───cad4tcl_Image.tcl
    │   ├───cad4tcl_tdom.tcl
    │   ├───cad4tcl_utility.tcl
    │   ├───class_CADCanvas.tcl
    │   ├───class_CanvasFactory.tcl
    │   ├───class_DimensionFactory.tcl
    │   ├───class_Dimension_Angle.tcl
    │   ├───class_Dimension_Length.tcl
    │   ├───class_Dimension_Radius.tcl
    │   ├───class_Extension_DXF_Canvas.tcl
    │   ├───class_Extension_DXF_PathCanvas.tcl
    │   ├───class_Extension_SVG_Canvas.tcl
    │   ├───class_Extension_SVG_PathCanvas.tcl
    │   ├───class_ItemIF_Canvas.tcl
    │   ├───class_ItemIF_PathCanvas.tcl
    │   ├───math.tcl
    │   ├───super_Canvas.tcl
    │   ├───super_Dimension.tcl
    │   ├───super_Extension_DXF.tcl
    │   ├───super_Extension_SVG.tcl
    │   ├───super_ItemIF.tcl
    │   └───vectorfont.tcl
    ├───svg
    │   └cfg_Corner.svg
    └───test
        └...


Package Classes

class: cad4tcl::CADCanvas

superclass: cad4tcl::Canvas__Super

file: lib/class_CADCanvas.tcl
  • constructor {canvasPath cv_width cv_height stageFormat stageScale stageBorder args}
  • method unknown {target_method args}
  • method configure {category key {value {__undefinedValue__}}}
  • method create {type coordList args}
  • method createConfigCorner {eventCommand}
  • method createConfigContainer {{title {Config}}}
  • method createDivContainer {title x y}
  • method __createDimension {type coordList args}
  • method itemconfigure {itemTag args}
  • method itemcget {itemTag option}
  • method export {fileFormat fileName}
  • method deleteContent {}
  • method deleteConfigCorner {}
  • method deleteConfigContainer {}
  • method deleteDivContainer {}
  • method deleteDimension {}
  • method getBottomLeft {}
  • method getCenter {}
  • method getSize {}
  • method getLength {length}
  • method getLengthCanvas {args}
  • method getPositionCanvas {x y}
  • method getStageFormat {}
  • method getStageSize {}
  • method getDivContainer {}
  • method reportPointer {x y}
  • method repositionPointerReport {}
  • method resize {}
  • method fit {}
  • method center {{scale 1.0}}
  • method fitContent {tagList}
  • method centerContent {tagList {vectorOffset {0 0}}}
  • method transformContent {tagID {transform {0 0}} {scale {0 0}} {orient {center}} args}
  • method registerClickObject {objectID {command {}}}
  • method registerDragObject {objectID {command {}}}
  • method eventClick_B1 {x y tagID {type {move}}}
  • method eventMotion_B1 {x y}
  • method eventRelease_B1 {x y}
  • method eventClick_B3 {x y tagID {type {zoom}}}
  • method eventMotion_B3 {x y}
  • method eventRelease_B3 {x y}
  • method EventCheckCurrent {tagID}
  • method EventCheckRelease {tagID}
  • method SetMark {x y type}
  • method SetRange {x y}
  • method CheckConfigCorner {tagID}
  • method CheckConfigContainer {tagID}
  • method CheckClickObject {tagID}
  • method GetGroupObject {tagID}
  • method CheckDragObject {tagID}
  • method CheckNoDrag {tagID}
  • method CheckDivContainer {tagID}
  • method MoveVector {tagID x y}
  • method ZoomArea {bbox}
  • method CenterBBox {bbox {scale 1.0}}
  • method DragContent {tagId x y}
  • method UpdateCanvasItems {{scaleFactor {}}}
  • method UpdateCanvas {}
  • method FindClosest {x y}
  • method UpdateItemInterface {}
  • method UpdateDraft {}
  • method CreateReportDOM {}
  • method updateReportDOM {}

class: cad4tcl::CanvasFactory

file: lib/class_CanvasFactory.tcl
  • constructor {}
  • method unknown {target_method args}
  • method create {parentWidget cv_width cv_height stageFormat stageScale stageBorder args}
  • method createNew {parentWidget width height {stageFormat {noFormat}} {stageScale 1.0} {stageBorder 10} args}
  • method getMemberDOM {}
  • method getMemberList {}
  • method reportMemberList {}

class cad4tcl::DimensionFactory

file: lib/class_DimensionFactory.tcl
  • constructor {cvObj itemIF args}
  • method unknown {target_method args}
  • method create {type coordList args}
  • method get_memberList {}
  • method report_memberList {}
  • method delete_Member {}

class cad4tcl::AngleDimension

superclass: cad4tcl::Dimension__Super

file: lib/class_Dimension_Angle.tcl
  • constructor {cvObj itemIF p_Coords dimDistance {textOffset 0} {colour black}}
  • method unknown {target_method args}
  • method createObject {p_Coords dimRadius {textOffset 0} {colour black}}
  • method get_dimensionType {}

class: cad4tcl::LengthDimension

superclass: cad4tcl::Dimension__Super

file: lib/class_Dimension_Length.tcl
  • constructor {cvObj itemIF p_Coords dimOrientation dimDistance {textOffset 0} {colour black}}
  • method unknown {target_method args}
  • method createObject {p_Coords dimOrientation dimDistance {textOffset 0} {colour black}}
  • method get_dimensionType {}

class: cad4tcl::RadiusDimension

superclass: cad4tcl::Dimension__Super

file: lib/class_Dimension_Radius.tcl
  • constructor {cvObj itemIF p_Coords dimDistance {textOffset 0} {colour black}}
  • method unknown {target_method args}
  • method createObject {p_Coords dimDistAngle {textOffset 0} {colour black}}
  • method get_dimensionType {}

class: cad4tcl::Extension_DXF_Canvas

superclass: cad4tcl::Extension_DXF__Super

file: lib/class_Extension_DXF_Canvas.tcl
  • constructor {cvObj args}
  • method unknown {target_method args}

class: cad4tcl::Extension_DXF_PathCanvas

superclass: cad4tcl::Extension_DXF__Super

file: lib/class_Extension_DXF_PathCanvas.tcl
  • constructor {cvObj args}
  • method unknown {target_method args}
  • method exportFile {dxfFile}

class: cad4tcl::Extension_SVG_Canvas

superclass: cad4tcl::Extension_SVG__Super

file: lib/class_Extension_SVG_Canvas.tcl
  • constructor {cvObj itemIF args}
  • method unknown {target_method args}

class: cad4tcl::Extension_SVG_PathCanvas

superclass: cad4tcl::Extension_SVG__Super

file: lib/class_Extension_SVG_PathCanvas.tcl
  • constructor {cvObj itemIF args}
  • method unknown {target_method args}
  • method createElement {svgNode canvasPosition svgCenter angle svgTag {style {}}}
  • method exportFile {{svgFile {}}}
  • method CreateSVG_line {cv cvItem}
  • method CreateSVG_circle {cv cvItem}
  • method CreateSVG_ellipse {cv cvItem}
  • method CreateSVG_path {cv cvItem}
  • method CreateSVG_pline {cv cvItem}
  • method CreateSVG_polyline {cv cvItem}
  • method CreateSVG_polygon {cv cvItem}
  • method CreateSVG_prect {cv cvItem}
  • method CreateSVG_oval_template {cv cvItem}

class: cad4tcl::ItemInterface_Canvas

superclass: cad4tcl::ItemInterface__Super

file: lib/class_ItemIF_Canvas.tcl
  • constructor {cvObj}
  • method unknown {target_method args}
  • method update {}

class: cad4tcl::ItemInterface_PathCanvas

superclass: cad4tcl::ItemInterface__Super

file: lib/class_ItemIF_PathCanvas.tcl
  • constructor {cvObj}
  • method unknown {target_method args}
  • method update {}
  • method create {type args}
  • method itemconfigure {itemTag argList}
  • method itemcget {itemTag option}
  • method delete {item}
  • method getLineWidth {lineWidth}
  • method UpdateItemAttributes {type argDict formatSize}
  • method createArc {coordList argList}
  • method createCenterLine {coordList argList}
  • method createCircle {coordList argList}
  • method createLine {coordList argList}
  • method createOval {coordList argList}
  • method createOvalArc {coordList argList}
  • method createOvalArc2 {coordList argList}
  • method createPath {pathDef argList}
  • method createPolygon {coordList argList}
  • method createRectangle {coordList argList}
  • method createVectorText {coordList argList}
  • method createDraftText {coordList argList}
  • method _convertBottomLeft {scale shapeDef}

superclass: cad4tcl::Canvas__Super

file: lib/super_Canvas.tcl
  • constructor {parentWidget cv_width cv_height stageFormat stageScale stageBorder}
  • method unknown {target_method args}
  • method CreateStage {{type sheet}}
  • method CreateWindow {coordList argList}
  • method reportSettings {}
  • method getPackageHomeDir {}
  • method getCanvas {}
  • method getDimensionFactory {}
  • method getItemInterface {}
  • method getOrigin {{tagID __Stage__}}
  • method addtag {args}
  • method bbox {args}
  • method bbox2 {args}
  • method bind {args}
  • method coords {args}
  • method delete {args}
  • method dtag {args}
  • method find {args}
  • method focus {tagID}
  • method gettags {tagID}
  • method itemcget {args}
  • method lower {args}
  • method move {tagID xAmount yAmount}
  • method raise {args}
  • method scale {args}
  • method type {tagID}

superclass: cad4tcl::Dimension__Super

file: lib/super_Dimension.tcl
  • constructor {}
  • method setCanvasSettings {}
  • method fit2Canvas {{myItem {}}}
  • method get_parentCanvas {}
  • method add_UID {tag}
  • method get_dimensionTag {}
  • method get_dimensionType {}
  • method get_textTag {}
  • method get_editTag {}
  • method get_UID {}
  • method createSensitiveArea {{activeColor wheat}}
  • method report_UID {}
  • method noramlizeAngle {angle}
  • method createLine_2 {p1 p2 colour}
  • method createArc_2 {p r start extent colour}
  • method createLineEnd_2 {p end_angle colour {style inside}}
  • method createText_2 {dimValue format p dimAngle colour}
  • method createPoint_2 {p radius colour}

superclass: cad4tcl::Extension_DXF__Super

file: lib/super_Extension_DXF.tcl
  • constructor {cvObj args}
  • method unknown {target_method args}
  • method exportFile {dxfFile}
  • method scale_Value_flipXY {args}
  • method scale_Value {args}
  • method dxf_Header {x0 y0 x1 y1}
  • method dxf_format {args}
  • method dxf_LType {name {flags 0}}
  • method dxf_Layer {{name 0} {flags 0} {color 7} {ltype 0}}
  • method dxf_rect {x y w h { t 0 } { o 0 }}
  • method dxf_solid {x1 y1 x2 y2 x3 y3 x4 y4}
  • method dxf_solidbox {x1 y1 x2 y2 {color 256}}
  • method formatXColor {rgb}

superclass: cad4tcl::Extension_SVG__Super

file: lib/super_Extension_SVG.tcl
  • constructor {cvObj itemIF args}
  • method unknown {target_method args}
  • method create {parentWidget cv_width cv_height stageFormat stageScale stageBorder args}
  • method createNew {parentWidget width height {stageFormat {noFormat}} {stageScale 1.0} {stageBorder 10} args}
  • method getMemberDOM {}
  • method getMemberList {}
  • method reportMemberList {}

superclass: cad4tcl::ItemInterface__Super

file: lib/super_ItemIF.tcl
  • constructor {cvObj}
  • method unknown {target_method args}
  • method updateConfig {}
  • method create {type args}
  • method itemconfigure {itemTag argList}
  • method itemcget {itemTag option}
  • method export {fileFormat fileName}
  • method delete {item}
  • method configure {key {value __noValue__}}
  • method UpdateItemAttributes {type argDict}
  • method createArc {coordList argList}
  • method createCenterLine {coordList argList}
  • method createCircle {coordList argList}
  • method createLine {coordList argList}
  • method createOval {coordList argList}
  • method createOvalArc {coordList argList}
  • method createOvalArc2 {coordList argList}
  • method createPolygon {coordList argList}
  • method createRectangle {coordList argList}
  • method createVectorText {coordList argLis}
  • method createText {coordList argList}
  • method createDraftFrame {argList}
  • method createDraftLabel {coordList argList}
  • method createDraftLine {coordList argList}
  • method createDraftText {coordList argList}
  • method updateDraftFrame {}
  • method createDraftRaster {argList}
  • method createSVG {coordList argList {style {cad}}}
  • method deleteDimension {}
  • method exportDXF {fileName}
  • method exportSVG {fileName}
  • method getPointOnEllipse {r1 r2 phi}
  • method getPointOnEllipse2 {r1 r2 phi}
  • method _____getDomNode {}


Package Namespace: extension

namespace: cad4tcl

file: lib/cad4tcl_tdom.tcl
  • proc cad4tcl::getXMLRoot {}
  • proc cad4tcl::getNodeRoot {pathString}
  • proc cad4tcl::setNodeAttributeRoot {pathString attribute value}
  • proc cad4tcl::getNodeAttributeRoot {pathString attribute}
  • proc cad4tcl::getNode {node pathString}
  • proc cad4tcl::setNodeAttribute {node pathString attribute value}
  • proc cad4tcl::getNodeAttribute {node pathString attribute}
  • proc cad4tcl::getCanvasDOMNode {pathString}
  • proc cad4tcl::reportXML {parent {counter {?}}}
  • proc cad4tcl::reportXMLRoot {}

namespace: cad4tcl

file: lib/cad4tcl_utility.tcl
  • proc cad4tcl::_convertBottomLeft {scale shapeDef}
  • proc cad4tcl::_flattenCoordList {args}
  • proc cad4tcl::_flattenNestedList {args}
  • proc cad4tcl::_getFontSize {{formatKey A4} {size f1}}
  • proc cad4tcl::_getBBoxInfo {bbox {type size}}
  • proc cad4tcl::_getBottomLeft {w}
  • proc cad4tcl::_getFormatSize {formatKey}
  • proc cad4tcl::_getUnitRefScale {stageUnit}
  • proc cad4tcl::_getTagList {argList}
  • proc cad4tcl::_____getFormatSize {{formatKey A4}}

namespace: cad4tcl::math

file: lib/math.tcl
  • proc cad4tcl::math::rotateCoordList { p_cent p_list angle }
  • proc cad4tcl::math::addVectorCoordList {v p_list {scaling 1}}
  • proc cad4tcl::math::scaleCoordList {pRef ptList scale}
  • proc cad4tcl::math::rotatePointList {p_cent p_list angle}
  • proc cad4tcl::math::addVectorPointList {v p_list {scaling 1}}
  • proc cad4tcl::math::mirrorPointList {p_list axle}
  • proc cad4tcl::math::mirrorCoordList {ptList axle}
  • proc cad4tcl::math::rotatePoint {p_cent p_rot angle}
  • proc cad4tcl::math::rotateLine {p l angle}
  • proc cad4tcl::math::dirAngle {p1 p2}
  • proc cad4tcl::math::dirAngle_radiant {p1 p2}
  • proc cad4tcl::math::dirAngle_degree {p1 p2}
  • proc cad4tcl::math::dirCarthesian {angle}
  • proc cad4tcl::math::dirAngle_Coincidence {p1 p2 tolerance p_perp}
  • proc cad4tcl::math::checkPointCoincidence {p1 p2 {tolerance {0.0001}}}
  • proc cad4tcl::math::mirrorPoint {p1 p2 p3}
  • proc cad4tcl::math::intersectPerp {p1 p2 p3}
  • proc cad4tcl::math::distancePerp {p1 p2 p3}
  • proc cad4tcl::math::offsetOrientation {p1 p2 p3}
  • proc cad4tcl::math::length {p1 p2}
  • proc cad4tcl::math::center {p1 p2}
  • proc cad4tcl::math::unifyVectorPointList {vct {length {1.0}}}
  • proc cad4tcl::math::unifyVector {p1 p2 {length {1.0}}}
  • proc cad4tcl::math::cathetusPoint {p1 p2 cathetus {position {close}}}
  • proc cad4tcl::math::parallel {p1 p2 distance {direction {right}}}
  • proc cad4tcl::math::perpendicular {p1 p2 distance {direction {right}}}
  • proc cad4tcl::math::perpendicular_local {vct {direction right}}
  • proc cad4tcl::___scalarProduct {v s}
  • proc cad4tcl::math::angle_Triangle {a b c}
  • proc cad4tcl::math::tangent_2_circles {p1 p2 r1 r2 {type {outside}} {side {right}}}
  • proc cad4tcl::math::intersectVector {v1 v2 {errorMode {}}}
  • proc cad4tcl::math::intersectPoint {p1 p2 p3 p4 {errorMode {}}}
  • proc cad4tcl::math::intersectPointVector {p1 v1 p3 v3 {errorMode {}}}
  • proc cad4tcl::math::angle {p1 pc p3}
  • proc cad4tcl::math::angleVector {vct}
  • proc cad4tcl::math::anglePoint {p}
  • proc cad4tcl::math::localVector_2_Degree {locVector}
  • proc cad4tcl::math::bisectAngle {p1 p2 p3}
  • proc cad4tcl::math::trisectAngle {p1 p2 p3}
  • proc cad4tcl::math::addVector {v1 v2 {scaling 1}}
  • proc cad4tcl::math::subVector {v1 v2}
  • proc cad4tcl::math::rad {arc}
  • proc cad4tcl::math::grad {arc}
  • proc cad4tcl::math::vector {arc}
  • proc cad4tcl::math::VCross {v1 v2}
  • proc cad4tcl::math::VRotate {v beta {unit {rad}}}
  • proc cad4tcl::math::matrixMultiplyList {mList}
  • proc cad4tcl::math::matrixMultiply {m1 m2}
  • proc cad4tcl::math::matrixTranslate {m args}
  • proc cad4tcl::math::matrixScale {m args}
  • proc cad4tcl::math::matrixRotate {m angle}
  • proc cad4tcl::math::transformPointList {pointList m}

namespace: cad4tcl::image

file: lib/cad4tcl_Image.tcl
  • proc cad4tcl::image::readFile {canvasDOMNode file {canvasPosition {0 0}} {anchor {bottomLeft}} {angle {0}} {customTag {}}}
  • proc cad4tcl::image::scale {image scale}
  • proc cad4tcl::reportObjectBBox {canvasDOMNode obj}


vectorfont Namespace

vectorfont

namespace: vectorfont

file: lib/vectorfont.tcl
  • proc vectorfont::RotateItem {w tagOrId Ox Oy angle}
  • proc vectorfont::draw_seg {c offs}
  • proc vectorfont::draw_arc {c rad sta ext sign}
  • proc vectorfont::next_byte {args}
  • proc vectorfont::process {canv code}
  • proc vectorfont::process {canv code}
  • proc vectorfont::draw_error {canv id}
  • proc vectorfont::compileChar {canv id}
  • proc vectorfont::pre_process {}
  • proc vectorfont::load_shape {shp_file}
  • proc vectorfont::setposition {x y}
  • proc vectorfont::setangle {ang}
  • proc vectorfont::setscale {factor}
  • proc vectorfont::setline {width}
  • proc vectorfont::setcolor {color}
  • proc vectorfont::setfont {id}
  • proc vectorfont::setalign {dir}
  • proc vectorfont::setCanvas {canv value}
  • proc vectorfont::drawtext {canv txt}
  • proc vectorfont::get_characterList {}