Package wprover

Class DrawBase

  • Direct Known Subclasses:
    DrawProcess

    public class DrawBase
    extends java.lang.Object
    DrawBase is a class that provides methods for drawing geometric objects and handling user interactions. It includes methods for drawing points, lines, circles, polygons, and other geometric shapes. It also provides methods for handling mouse events and managing the drawing environment.
    • Constructor Summary

      Constructors 
      Constructor Description
      DrawBase()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCircle​(Circle c)
      Adds the specified circle to the list of circles if it is not already present.
      void addLine​(CLine ln)
      Adds the specified line to the list of lines if it is not already present.
      protected boolean check_cc_inter​(Circle c1, Circle c2)
      Checks if two circles intersect based on their radii and center distance.
      protected boolean check_lc_inter​(CLine ln, Circle c2)
      Checks if a line and a circle intersect.
      static boolean check_same_side​(CPoint p1, CPoint p2, CPoint p3, CPoint p4)
      Checks if points p3 and p4 lie on the same side of the line defined by p1 and p2.
      static boolean check_triangle_inside​(CPoint p, CPoint p1, CPoint p2, CPoint p3)
      Determines if point p lies inside the triangle defined by p1, p2, and p3.
      static double collv​(CPoint A, CPoint B, CPoint C)
      Computes the cross product of vectors AB and AC.
      boolean containFreezedPoint()
      Checks if there is at least one freezed point in the diagram.
      CPoint CreateATempPoint​(double x, double y)
      Creates a temporary point with the specified coordinates.
      boolean decide_wu_identical​(CPoint p1, CPoint p2)
      Determines whether two points are identical by comparing their Wu representations.
      boolean div_set​(TMono m1)
      Checks if the given TMono reduces to zero relative to the polynomial set.
      void drawCatch​(java.awt.Graphics2D g2)
      Draws the catch indicator based on the current catch list and catch point.
      void drawCatchInterCross​(java.awt.Graphics2D g2)
      Draws a cross marker to indicate an intersection catch point.
      void drawCatchObjName​(java.awt.Graphics2D g2)
      Draws the name of the caught object if exactly one object is caught.
      void drawCatchRect​(java.awt.Graphics2D g2)
      Draws a catch rectangle around the catch point if certain conditions are met.
      void drawcircle2p​(double x1, double y1, double x2, double y2, java.awt.Graphics2D g2)
      Draws a circle defined by two points.
      void drawCross​(int x, int y, int w, java.awt.Graphics2D g2)
      Draws a cross centered at the given coordinates with the specified half-width.
      void drawGrid​(java.awt.Graphics2D g2)
      Draws the grid on the drawing area if grid drawing or snapping is enabled.
      void drawList​(java.util.Vector list, java.awt.Graphics2D g2)
      Draws all objects in the given list using the provided Graphics2D context.
      void drawPerpFoot​(java.awt.Graphics2D g2, java.util.Vector vlist, int type)
      Draws the perpendicular footmarks for constraints.
      void drawpoint​(CPoint p, java.awt.Graphics2D g2)
      Draws the specified point using its own drawing method.
      void drawPointNameLocation​(CPoint p, java.awt.Graphics2D g2)
      Draws the name and coordinate location of a point.
      void drawPointOrCross​(java.awt.Graphics2D g2)
      Draws either a point or a cross based on the object's state.
      void drawRect​(int x, int y, int x1, int y1, java.awt.Graphics2D g2)
      Draws a rectangle defined by two opposite corner coordinates.
      void drawSelect​(java.util.Vector list, java.awt.Graphics2D g2)
      Draws the selection highlight for a list of geometric objects.
      void drawTipRect​(int x, int y, java.awt.Graphics2D g2)
      Draws a tip rectangle around the specified coordinates.
      void drawTipSquare​(CPoint p1, CPoint p2, CPoint p, java.awt.Graphics2D g2)
      Draws a tip square marker using the provided points.
      void drawTipTirangle​(CPoint p1, CPoint p2, CPoint p, java.awt.Graphics2D g2)
      Draws a tip triangle marker based on the provided points.
      void drawTTFoot​(int type, java.util.Vector vlist, java.awt.Graphics2D g2, double x, double y, CPoint pc, CPoint p1, CPoint p2)
      Draws two footmarks for a constraint between two lines.
      void DWButtonDown​(double x, double y)
      Handles a button down event at the specified coordinates.
      Circle fd_circle​(CPoint p1, CPoint p2)
      Finds a circle defined by a center point and a point on its circumference.
      CLine fd_line​(CPoint p1, CPoint p2)
      Finds and returns an existing line that connects the two specified points.
      boolean find_tmark​(CPoint p1, CPoint p2, CPoint p3, CPoint p4)
      Determines if a tmark exists that contains the specified four points.
      CTMark findCTMark​(CPoint p1, CPoint p2, CPoint p3, CPoint p4)
      Searches for a CTMark based on two pairs of points.
      CPoint findPoint​(java.lang.String name)
      Searches for a point with the given name in the point list.
      java.awt.Rectangle getBounds()
      Calculates and returns the bounding rectangle that encompasses all points, circles, and text elements.
      CPoint getCatchHVPoint​(int CatchType)
      Retrieves a horizontal or vertical catch point based on the catch type.
      java.util.Vector getPointList()
      Returns a copy of the point list.
      protected CPoint[] getPoints​(Cons c)
      Retrieves an array of points extracted from the given construct.
      int getPointSize()
      Returns the number of points in the drawing.
      int getPoolA​(int a, int index)
      Returns the parameter at a specific index for the given geometric object type.
      int getPooln​(int a)
      Returns the number of parameters for the specified geometric object type.
      protected TMono getTMono​(Cons c)
      Builds a TMono object that represents a geometric relation based on the construct.
      void hvCatchPoint()
      Adjusts the catch point type by examining proximity to other points.
      double[] intersect_cc​(Circle c1, Circle c2)
      Computes the intersection points of two circles.
      double[] intersect_ll​(CLine ln1, CLine ln2)
      Computes the intersection point of two lines.
      boolean isFrozen()
      Determines if the diagram is in a frozen state.
      boolean isLineDrawn​(CPoint p1, CPoint p2)
      Checks if a line connecting the two given points is drawn.
      protected static boolean isZero​(double r)
      Determines if a given value is effectively zero within a tolerance.
      protected static boolean near​(double x, double y, double x1, double y1)
      Checks whether two coordinates are nearly equal based on a tolerance.
      void printPoly​(TPoly p)
      Prints the polynomial represented by the TPoly chain.
      void removeFromeListLastNElements​(java.util.Vector v, int n)
      Removes the last n elements from the provided Vector.
      void setAntiAlias​(java.awt.Graphics2D g2)
      Sets the antialiasing rendering hint on the provided Graphics2D object based on the application setting.
      void setCatchHVPoint​(CPoint pv)
      Adjusts the provided point to align with a nearby point based on the catch type.
      void setCurrentDrawEnvironment​(java.awt.Graphics2D g2)
      Sets the current drawing environment parameters such as color and stroke.
      void setLanguage​(Language lan)
      Sets the language for the drawing environment.
      void setMouseInside​(boolean t)
      Sets the state indicating whether the mouse is inside the drawing area.
      static double signArea​(double x1, double y1, double x2, double y2, double x3, double y3)
      Computes the signed area determined by three points.
      void unfreezeAllPoints()
      Unfreezes all points in the diagram.
      void zoom_in​(double x, double y, int zz)
      Zooms in the diagram from a specified center by adjusting the points.
      void zoom_out​(double x, double y, int zz)
      Zooms out the diagram from a specified center by adjusting the points.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pointlist

        protected java.util.Vector pointlist
      • linelist

        protected java.util.Vector linelist
      • circlelist

        protected java.util.Vector circlelist
      • anglelist

        protected java.util.Vector anglelist
      • constraintlist

        protected java.util.Vector constraintlist
      • distancelist

        protected java.util.Vector distancelist
      • polygonlist

        protected java.util.Vector polygonlist
      • textlist

        protected java.util.Vector textlist
      • tracelist

        protected java.util.Vector tracelist
      • otherlist

        protected java.util.Vector otherlist
      • SelectList

        protected java.util.Vector SelectList
      • CatchList

        protected java.util.Vector CatchList
      • CatchPoint

        protected CPoint CatchPoint
      • MouseX

        protected int MouseX
      • MouseY

        protected int MouseY
      • mouseCatchX

        protected int mouseCatchX
      • mouseCatchY

        protected int mouseCatchY
      • CatchType

        protected int CatchType
      • parameter

        protected Param[] parameter
      • pptrans

        protected double[] pptrans
      • paraBackup

        protected double[] paraBackup
      • polylist

        protected TPoly polylist
      • pblist

        protected TPoly pblist
      • CurrentAction

        protected int CurrentAction
      • name

        protected java.lang.String name
      • Width

        protected double Width
      • Height

        protected double Height
      • GridX

        protected int GridX
      • GridY

        protected int GridY
      • DRAWGRID

        protected boolean DRAWGRID
      • SNAP

        protected boolean SNAP
      • gridColor

        protected java.awt.Color gridColor
      • paraCounter

        protected int paraCounter
      • pnameCounter

        protected int pnameCounter
      • plineCounter

        protected int plineCounter
      • pcircleCounter

        protected int pcircleCounter
      • poly

        protected static GeoPoly poly
      • charset

        protected static CharSet charset
      • isPointOnObject

        protected boolean isPointOnObject
      • isPointOnIntersection

        protected boolean isPointOnIntersection
      • catchX

        protected double catchX
      • catchY

        protected double catchY
      • file

        protected java.io.File file
      • mouseInside

        protected boolean mouseInside
      • STATUS

        protected int STATUS
      • gxInstance

        protected GExpert gxInstance
      • footMarkShown

        protected boolean footMarkShown
      • footMarkLength

        protected double footMarkLength
      • POOL

        public static final int[][] POOL
        The POOL array contains the types of geometric objects and their parameters. Each entry in the array represents a different type of geometric object, with the first element being the type identifier and the subsequent elements representing the number of parameters required for that object.
    • Constructor Detail

      • DrawBase

        public DrawBase()
    • Method Detail

      • getPooln

        public final int getPooln​(int a)
        Returns the number of parameters for the specified geometric object type. For a polygon (\_D\_POLYGON), returns the current status if less than 10, otherwise 0. For other types, iterates through the POOL array and returns the parameter count. Returns -1 if the type is not found.
        Parameters:
        a - the geometric object type identifier
        Returns:
        the number of parameters for the object type, or -1 if not found
      • getPoolA

        public int getPoolA​(int a,
                            int index)
        Returns the parameter at a specific index for the given geometric object type. Iterates through the POOL array and returns the value at the specified index. If the index is out of bounds, returns 1.
        Parameters:
        a - the geometric object type identifier
        index - the index of the parameter to retrieve
        Returns:
        the parameter value at the given index, or 1 if not found
      • setLanguage

        public void setLanguage​(Language lan)
        Sets the language for the drawing environment.
        Parameters:
        lan - the Language instance to be set
      • DWButtonDown

        public void DWButtonDown​(double x,
                                 double y)
        Handles a button down event at the specified coordinates. The implementation depends on the current action.
        Parameters:
        x - the x-coordinate of the button down event
        y - the y-coordinate of the button down event
      • setMouseInside

        public void setMouseInside​(boolean t)
        Sets the state indicating whether the mouse is inside the drawing area.
        Parameters:
        t - true if the mouse is inside, false otherwise
      • CreateATempPoint

        public final CPoint CreateATempPoint​(double x,
                                             double y)
        Creates a temporary point with the specified coordinates.
        Parameters:
        x - the x-coordinate of the temporary point
        y - the y-coordinate of the temporary point
        Returns:
        a new temporary CPoint instance
      • fd_line

        public CLine fd_line​(CPoint p1,
                             CPoint p2)
        Finds and returns an existing line that connects the two specified points. Returns null if no such line exists or if either point is null.
        Parameters:
        p1 - the first point
        p2 - the second point
        Returns:
        the CLine connecting the two points, or null if not found
      • setAntiAlias

        public final void setAntiAlias​(java.awt.Graphics2D g2)
        Sets the antialiasing rendering hint on the provided Graphics2D object based on the application setting.
        Parameters:
        g2 - the Graphics2D object on which to set the anti-aliasing
      • drawPerpFoot

        public final void drawPerpFoot​(java.awt.Graphics2D g2,
                                       java.util.Vector vlist,
                                       int type)
        Draws the perpendicular footmarks for constraints. Iterates through the constraint list and draws the foot for each applicable constraint. Supports constraint types such as PERPENDICULAR, PFOOT, RIGHT\_ANGLED\_TRIANGLE, and RIGHT\_ANGLE\_TRAPEZOID.
        Parameters:
        g2 - the Graphics2D object used for drawing
        vlist - a Vector used for additional drawing information
        type - the mode type (0 for drawing and 1 for PostScript)
      • removeFromeListLastNElements

        public final void removeFromeListLastNElements​(java.util.Vector v,
                                                       int n)
        Removes the last n elements from the provided Vector.
        Parameters:
        v - the Vector from which elements will be removed
        n - the number of elements to remove from the end
      • getPointSize

        public final int getPointSize()
        Returns the number of points in the drawing.
        Returns:
        the size of the point list
      • getPointList

        public final java.util.Vector getPointList()
        Returns a copy of the point list.
        Returns:
        a new Vector containing all points.
      • drawList

        public final void drawList​(java.util.Vector list,
                                   java.awt.Graphics2D g2)
        Draws all objects in the given list using the provided Graphics2D context.
        Parameters:
        list - the Vector containing drawable objects.
        g2 - the Graphics2D object used for drawing.
      • drawPointNameLocation

        public final void drawPointNameLocation​(CPoint p,
                                                java.awt.Graphics2D g2)
        Draws the name and coordinate location of a point.
        Parameters:
        p - the point whose location is displayed.
        g2 - the Graphics2D context used for drawing.
      • setCurrentDrawEnvironment

        public final void setCurrentDrawEnvironment​(java.awt.Graphics2D g2)
        Sets the current drawing environment parameters such as color and stroke.
        Parameters:
        g2 - the Graphics2D object where the environment settings are applied.
      • drawGrid

        public final void drawGrid​(java.awt.Graphics2D g2)
        Draws the grid on the drawing area if grid drawing or snapping is enabled.
        Parameters:
        g2 - the Graphics2D context used for drawing the grid.
      • drawTipTirangle

        public final void drawTipTirangle​(CPoint p1,
                                          CPoint p2,
                                          CPoint p,
                                          java.awt.Graphics2D g2)
        Draws a tip triangle marker based on the provided points.
        Parameters:
        p1 - the first point defining the triangle.
        p2 - the second point defining the triangle.
        p - the reference point for triangle alignment.
        g2 - the Graphics2D context used for drawing.
      • drawCross

        public final void drawCross​(int x,
                                    int y,
                                    int w,
                                    java.awt.Graphics2D g2)
        Draws a cross centered at the given coordinates with the specified half-width.
        Parameters:
        x - the x-coordinate of the center.
        y - the y-coordinate of the center.
        w - the half-width of the cross.
        g2 - the Graphics2D context used for drawing.
      • drawCatchRect

        public void drawCatchRect​(java.awt.Graphics2D g2)
        Draws a catch rectangle around the catch point if certain conditions are met.
        Parameters:
        g2 - the Graphics2D context used for drawing.
      • drawCatchInterCross

        public void drawCatchInterCross​(java.awt.Graphics2D g2)
        Draws a cross marker to indicate an intersection catch point.
        Parameters:
        g2 - the Graphics2D context used for drawing.
      • drawTipRect

        public void drawTipRect​(int x,
                                int y,
                                java.awt.Graphics2D g2)
        Draws a tip rectangle around the specified coordinates.
        Parameters:
        x - the x-coordinate for the tip rectangle.
        y - the y-coordinate for the tip rectangle.
        g2 - the Graphics2D context used for drawing.
      • drawPointOrCross

        public void drawPointOrCross​(java.awt.Graphics2D g2)
        Draws either a point or a cross based on the object's state.
        Parameters:
        g2 - the Graphics2D context used for drawing.
      • drawCatchObjName

        public void drawCatchObjName​(java.awt.Graphics2D g2)
        Draws the name of the caught object if exactly one object is caught.
        Parameters:
        g2 - the Graphics2D context used for drawing.
      • drawTipSquare

        public final void drawTipSquare​(CPoint p1,
                                        CPoint p2,
                                        CPoint p,
                                        java.awt.Graphics2D g2)
        Draws a tip square marker using the provided points.
        Parameters:
        p1 - the first point defining the square.
        p2 - the second point defining the square.
        p - the reference point used for adjusting the square.
        g2 - the Graphics2D context used for drawing.
      • drawTTFoot

        public void drawTTFoot​(int type,
                               java.util.Vector vlist,
                               java.awt.Graphics2D g2,
                               double x,
                               double y,
                               CPoint pc,
                               CPoint p1,
                               CPoint p2)
        Draws two footmarks for a constraint between two lines.
        Parameters:
        type - the drawing mode (0 for direct drawing, non-zero for vector accumulation)
        vlist - the vector list to add drawing points if not drawing directly
        g2 - the Graphics2D context to draw on
        x - the starting x coordinate for the footmark
        y - the starting y coordinate for the footmark
        pc - the common point for both lines (may be null)
        p1 - the first point defining the first line
        p2 - the second point defining the second line
      • drawCatch

        public void drawCatch​(java.awt.Graphics2D g2)
        Draws the catch indicator based on the current catch list and catch point. If no catch objects exist, draws smart horizontal/vertical catch lines. If one object exists, draws it with its predefined style. If multiple objects exist, displays a prompt for selection.
        Parameters:
        g2 - the Graphics2D context to draw on
      • isLineDrawn

        public boolean isLineDrawn​(CPoint p1,
                                   CPoint p2)
        Checks if a line connecting the two given points is drawn.
        Parameters:
        p1 - the first point
        p2 - the second point
        Returns:
        true if the line exists and is drawn; false otherwise
      • drawSelect

        public void drawSelect​(java.util.Vector list,
                               java.awt.Graphics2D g2)
        Draws the selection highlight for a list of geometric objects. Iterates over the list and draws each object with selection indication.
        Parameters:
        list - the list of objects to be highlighted
        g2 - the Graphics2D context to use for drawing
      • drawRect

        public void drawRect​(int x,
                             int y,
                             int x1,
                             int y1,
                             java.awt.Graphics2D g2)
        Draws a rectangle defined by two opposite corner coordinates. Four lines are drawn between the specified corners.
        Parameters:
        x - the x coordinate of the first corner
        y - the y coordinate of the first corner
        x1 - the x coordinate of the opposite corner
        y1 - the y coordinate of the opposite corner
        g2 - the Graphics2D context for drawing
      • drawcircle2p

        public void drawcircle2p​(double x1,
                                 double y1,
                                 double x2,
                                 double y2,
                                 java.awt.Graphics2D g2)
        Draws a circle defined by two points. The first point represents the center and the distance to the second point determines the radius.
        Parameters:
        x1 - the x coordinate of the center
        y1 - the y coordinate of the center
        x2 - the x coordinate of a point on the circle
        y2 - the y coordinate of a point on the circle
        g2 - the Graphics2D context for drawing
      • drawpoint

        public void drawpoint​(CPoint p,
                              java.awt.Graphics2D g2)
        Draws the specified point using its own drawing method.
        Parameters:
        p - the point to be drawn
        g2 - the Graphics2D context for drawing
      • addLine

        public void addLine​(CLine ln)
        Adds the specified line to the list of lines if it is not already present.
        Parameters:
        ln - the line to be added
      • addCircle

        public void addCircle​(Circle c)
        Adds the specified circle to the list of circles if it is not already present.
        Parameters:
        c - the circle to add
      • findPoint

        public CPoint findPoint​(java.lang.String name)
        Searches for a point with the given name in the point list.
        Parameters:
        name - the name of the point to search for
        Returns:
        the point with the specified name, or null if not found
      • fd_circle

        public Circle fd_circle​(CPoint p1,
                                CPoint p2)
        Finds a circle defined by a center point and a point on its circumference. Searches the circle list for a circle where the first point is the center and the second point lies on the circle.
        Parameters:
        p1 - the potential center point of the circle
        p2 - the potential point on the circumference
        Returns:
        the matching circle if found; otherwise, null
      • getBounds

        public java.awt.Rectangle getBounds()
        Calculates and returns the bounding rectangle that encompasses all points, circles, and text elements.
        Returns:
        the bounding Rectangle of the drawing.
      • signArea

        public static double signArea​(double x1,
                                      double y1,
                                      double x2,
                                      double y2,
                                      double x3,
                                      double y3)
        Computes the signed area determined by three points.
        Parameters:
        x1 - the x-coordinate of the first point.
        y1 - the y-coordinate of the first point.
        x2 - the x-coordinate of the second point.
        y2 - the y-coordinate of the second point.
        x3 - the x-coordinate of the third point.
        y3 - the y-coordinate of the third point.
        Returns:
        the signed area value.
      • check_same_side

        public static boolean check_same_side​(CPoint p1,
                                              CPoint p2,
                                              CPoint p3,
                                              CPoint p4)
        Checks if points p3 and p4 lie on the same side of the line defined by p1 and p2.
        Parameters:
        p1 - first point defining the line
        p2 - second point defining the line
        p3 - first point to test
        p4 - second point to test
        Returns:
        true if p3 and p4 are on the same side of the line; false otherwise
      • collv

        public static double collv​(CPoint A,
                                   CPoint B,
                                   CPoint C)
        Computes the cross product of vectors AB and AC.
        Parameters:
        A - the starting point
        B - the end point of the first vector
        C - the end point of the second vector
        Returns:
        the cross product value
      • check_triangle_inside

        public static boolean check_triangle_inside​(CPoint p,
                                                    CPoint p1,
                                                    CPoint p2,
                                                    CPoint p3)
        Determines if point p lies inside the triangle defined by p1, p2, and p3.
        Parameters:
        p - the point to test
        p1 - first vertex of the triangle
        p2 - second vertex of the triangle
        p3 - third vertex of the triangle
        Returns:
        true if p is inside the triangle; false otherwise
      • intersect_ll

        public double[] intersect_ll​(CLine ln1,
                                     CLine ln2)
        Computes the intersection point of two lines.
        Parameters:
        ln1 - the first line
        ln2 - the second line
        Returns:
        a two-element array with the x and y coordinates of the intersection, or null if undefined
      • intersect_cc

        public double[] intersect_cc​(Circle c1,
                                     Circle c2)
        Computes the intersection points of two circles.
        Parameters:
        c1 - the first circle
        c2 - the second circle
        Returns:
        an array containing the intersection coordinates; null if there is no intersection
      • check_cc_inter

        protected boolean check_cc_inter​(Circle c1,
                                         Circle c2)
        Checks if two circles intersect based on their radii and center distance.
        Parameters:
        c1 - the first circle
        c2 - the second circle
        Returns:
        true if the circles intersect within the defined tolerance
      • check_lc_inter

        protected boolean check_lc_inter​(CLine ln,
                                         Circle c2)
        Checks if a line and a circle intersect.
        Parameters:
        ln - the line
        c2 - the circle
        Returns:
        true if the line intersects the circle
      • isZero

        protected static boolean isZero​(double r)
        Determines if a given value is effectively zero within a tolerance.
        Parameters:
        r - the value to check
        Returns:
        true if the value is considered zero
      • near

        protected static boolean near​(double x,
                                      double y,
                                      double x1,
                                      double y1)
        Checks whether two coordinates are nearly equal based on a tolerance.
        Parameters:
        x - the first x-coordinate
        y - the first y-coordinate
        x1 - the second x-coordinate
        y1 - the second y-coordinate
        Returns:
        true if the points are near each other
      • getPoints

        protected CPoint[] getPoints​(Cons c)
        Retrieves an array of points extracted from the given construct.
        Parameters:
        c - the construct containing point identifiers
        Returns:
        an array of points, or null if a point cannot be found
      • getTMono

        protected TMono getTMono​(Cons c)
        Builds a TMono object that represents a geometric relation based on the construct.
        Parameters:
        c - the construct defining the relation
        Returns:
        the constructed TMono object, or null if it cannot be built
      • decide_wu_identical

        public boolean decide_wu_identical​(CPoint p1,
                                           CPoint p2)
        Determines whether two points are identical by comparing their Wu representations.
        Parameters:
        p1 - the first point
        p2 - the second point
        Returns:
        true if both points are considered identical
      • div_set

        public boolean div_set​(TMono m1)
        Checks if the given TMono reduces to zero relative to the polynomial set.
        Parameters:
        m1 - the TMono expression to check
        Returns:
        true if the expression is effectively zero within the polynomial context
      • printPoly

        public void printPoly​(TPoly p)
        Prints the polynomial represented by the TPoly chain.
        Parameters:
        p - the TPoly instance containing the polynomial
      • findCTMark

        public CTMark findCTMark​(CPoint p1,
                                 CPoint p2,
                                 CPoint p3,
                                 CPoint p4)
        Searches for a CTMark based on two pairs of points.
        Parameters:
        p1 - the first point of the first pair
        p2 - the second point of the first pair
        p3 - the first point of the second pair
        p4 - the second point of the second pair
        Returns:
        the CTMark if found, otherwise null
      • find_tmark

        public boolean find_tmark​(CPoint p1,
                                  CPoint p2,
                                  CPoint p3,
                                  CPoint p4)
        Determines if a tmark exists that contains the specified four points.
        Parameters:
        p1 - the first point
        p2 - the second point
        p3 - the third point
        p4 - the fourth point
        Returns:
        true if a matching tmark is found
      • containFreezedPoint

        public boolean containFreezedPoint()
        Checks if there is at least one freezed point in the diagram.
        Returns:
        true if any point is freezed, otherwise false
      • unfreezeAllPoints

        public void unfreezeAllPoints()
        Unfreezes all points in the diagram.
      • isFrozen

        public boolean isFrozen()
        Determines if the diagram is in a frozen state.
        Returns:
        true if any point is freezed, indicating the diagram is frozen
      • zoom_out

        public void zoom_out​(double x,
                             double y,
                             int zz)
        Zooms out the diagram from a specified center by adjusting the points.
        Parameters:
        x - the x-coordinate of the zoom center
        y - the y-coordinate of the zoom center
        zz - the zoom factor denominator
      • zoom_in

        public void zoom_in​(double x,
                            double y,
                            int zz)
        Zooms in the diagram from a specified center by adjusting the points.
        Parameters:
        x - the x-coordinate of the zoom center
        y - the y-coordinate of the zoom center
        zz - the zoom factor denominator
      • hvCatchPoint

        public void hvCatchPoint()
        Adjusts the catch point type by examining proximity to other points.
      • getCatchHVPoint

        public CPoint getCatchHVPoint​(int CatchType)
        Retrieves a horizontal or vertical catch point based on the catch type.
        Parameters:
        CatchType - the catch type indicator (2 for vertical, 3 for horizontal)
        Returns:
        the catch point if found, otherwise null
      • setCatchHVPoint

        public void setCatchHVPoint​(CPoint pv)
        Adjusts the provided point to align with a nearby point based on the catch type.
        Parameters:
        pv - the point to be adjusted