org.autopipes
Class DrawingMgrImp

java.lang.Object
  extended by org.autopipes.DrawingMgrImp
All Implemented Interfaces:
DrawingMgr, JAXBWrapper

public class DrawingMgrImp
extends java.lang.Object
implements DrawingMgr

Primary implementation of DrawingMgr.


Field Summary
 
Fields inherited from interface org.autopipes.DrawingMgr
CLS_COUPLING, CLS_HEAD, CLS_JUMP, CLS_LINE, CLS_TEXT, CLS_TEXTBOX
 
Constructor Summary
DrawingMgrImp()
          Default constructor.
 
Method Summary
static double angle(CtPoint ptO, CtPoint ptA, CtPoint ptB)
          Computes an angle defined by 3 points.
static boolean comparePoints(CtPoint ptA, CtPoint ptB, double tol)
          Checks if 2 points are co-located within a measurement tolerance.
static double distance(CtPoint ptA, CtPoint ptB)
          Computes a distance between 2 points.
static double dotProduct(CtPoint ptO, CtPoint ptA, CtPoint ptB)
          Computes dot (scalar) product defined by 3 points.
 java.lang.String getDrawingName()
          Gets a name of the drawing.
 java.util.List getEntityList()
          Gets a list of AutoCAD entities exported from the drawing.
static javax.xml.namespace.QName getQName()
           
 boolean isLoaded()
          Checks if contents is present.
static boolean isText(CtEntity ent)
          Checks if an AutoCAD entity object is a text or multi-text.
 void load(org.xml.sax.InputSource in)
          Hydrates from a source.
 void load(org.w3c.dom.Node in)
          Hydrates from a node.
static boolean pointOnSegment(CtPoint ptP, CtPoint ptA, CtPoint ptB, double tol)
          Checks if a point is located inside a segment.
 void unload()
          Discards current contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawingMgrImp

public DrawingMgrImp()
Default constructor.

Method Detail

getQName

public static javax.xml.namespace.QName getQName()

isText

public static boolean isText(CtEntity ent)
Checks if an AutoCAD entity object is a text or multi-text.

Parameters:
ent - the entity
Returns:
true if it is

comparePoints

public static boolean comparePoints(CtPoint ptA,
                                    CtPoint ptB,
                                    double tol)
Checks if 2 points are co-located within a measurement tolerance.

Parameters:
ptA - one point
ptB - another point
tol - the tolerance
Returns:
true if they are

distance

public static double distance(CtPoint ptA,
                              CtPoint ptB)
Computes a distance between 2 points.

Parameters:
ptA - one point
ptB - another point
Returns:
the distance

dotProduct

public static double dotProduct(CtPoint ptO,
                                CtPoint ptA,
                                CtPoint ptB)
Computes dot (scalar) product defined by 3 points.

Parameters:
ptO - center point
ptA - one leg point
ptB - another leg point
Returns:
the dot product

angle

public static double angle(CtPoint ptO,
                           CtPoint ptA,
                           CtPoint ptB)
Computes an angle defined by 3 points.

Parameters:
ptO - center of angle
ptA - one leg point
ptB - another leg point
Returns:
the angle

pointOnSegment

public static boolean pointOnSegment(CtPoint ptP,
                                     CtPoint ptA,
                                     CtPoint ptB,
                                     double tol)
Checks if a point is located inside a segment.

Parameters:
ptP - the point
ptA - one end of the segment
ptB - another end of the segment
tol - linear measumrement tolerance
Returns:
true if it is located there

load

public void load(org.xml.sax.InputSource in)
          throws javax.xml.bind.JAXBException
Hydrates from a source.

Specified by:
load in interface JAXBWrapper
Parameters:
in - the source
Throws:
javax.xml.bind.JAXBException

load

public void load(org.w3c.dom.Node in)
          throws javax.xml.bind.JAXBException
Description copied from interface: JAXBWrapper
Hydrates from a node.

Specified by:
load in interface JAXBWrapper
Parameters:
in - the node
Throws:
javax.xml.bind.JAXBException

unload

public void unload()
Discards current contents.

Specified by:
unload in interface JAXBWrapper

isLoaded

public boolean isLoaded()
Checks if contents is present.

Specified by:
isLoaded in interface JAXBWrapper
Returns:
true if it is

getDrawingName

public java.lang.String getDrawingName()
                                throws java.lang.IllegalAccessException
Gets a name of the drawing.

Specified by:
getDrawingName in interface DrawingMgr
Returns:
the name
Throws:
java.lang.IllegalAccessException - if no contents

getEntityList

public java.util.List getEntityList()
                             throws java.lang.IllegalAccessException
Gets a list of AutoCAD entities exported from the drawing.

Specified by:
getEntityList in interface DrawingMgr
Returns:
the list
Throws:
java.lang.IllegalAccessException - if no contents