Class GeometryPtr


  • public class GeometryPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • GeometryPtr

        public GeometryPtr​(long cPtr,
                           boolean cMemoryOwn)
      • GeometryPtr

        public GeometryPtr()
        Default constructor yielding a NULL-pointer.
      • GeometryPtr

        public GeometryPtr​(Geometry ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • getCPtr

        public static long getCPtr​(GeometryPtr obj)
      • delete

        public void delete()
      • deref

        public Geometry deref()
        The pointer stored in the object.
      • __ref__

        public Geometry __ref__()
        Dereferencing operator.
      • getDeref

        public Geometry getDeref()
        Member access operator.
      • equals

        public boolean equals​(Geometry p)
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • getScale

        public double getScale()
        gets the scaling factor applied when using this geometry
        Returns:
        the scale as double
      • setScale

        public void setScale​(double scale)
        set the scaling factor that should be applied to
        this geometry when used.
        Parameters:
        scale - [in] scale factor
      • setTransform

        public void setTransform​(Transform3D t3d)
        set transformation
        Parameters:
        t3d - [in] the new transform
      • getTransform

        public Transform3D getTransform()
        get transformation
        Returns:
        the Current transform
      • getGeometryData

        public GeometryDataPtr getGeometryData()
        get geometry data
        Returns:
        the geometry data stored
      • setGeometryData

        public void setGeometryData​(GeometryDataPtr data)
        set transformation
        Parameters:
        data - [in] the new geometry data
      • getName

        public java.lang.String getName()
        get name of this geometry
        Returns:
        name as string
      • getFilePath

        public java.lang.String getFilePath()
        get file path of this geometry
        Returns:
        the file path as string
      • getId

        public java.lang.String getId()
        get identifier of this geometry
        Returns:
        the id of the geometry
      • setName

        public void setName​(java.lang.String name)
        set name of this geometry
        Parameters:
        name - [in] the new name of the geometry
      • setFilePath

        public void setFilePath​(java.lang.String name)
        set file path this geometry
        Parameters:
        name - [in] path to a geometry file
      • setId

        public void setId​(java.lang.String id)
        set identifier of this geometry
        Parameters:
        id - [in] new id
      • setColor

        public void setColor​(short red,
                             short green,
                             short blue)
        set the color of the geometry
        Parameters:
        red - [in] the amount of red color 0-255
        green - [in] the amount of green color 0-255
        blue - [in] the amount of red color 0-255
      • setColor

        public void setColor​(float red,
                             float green,
                             float blue)
        set the color of the geometry
        Parameters:
        red - [in] the amount of red color 0-1
        green - [in] the amount of green color 0-1
        blue - [in] the amount of red color 0-1
      • setFrame

        public void setFrame​(FramePtr frame)
        Set the reference frame.
        Parameters:
        frame - [in] new reference frame.
      • getFrame

        public Frame getFrame()
        Get the reference frame.
        Returns:
        the reference frame.
      • setMask

        public void setMask​(int mask)
        Set the draw mask.
        Parameters:
        mask - [in] the draw mask.
      • getMask

        public int getMask()
        Get the draw mask.
        Returns:
        the draw mask.
      • makeSphere

        public GeometryPtr makeSphere​(double radi)
        util function for creating a Sphere geometry
      • makeBox

        public GeometryPtr makeBox​(double x,
                                   double y,
                                   double z)
        util function for creating a Box geometry
      • makeCone

        public GeometryPtr makeCone​(double height,
                                    double radiusTop,
                                    double radiusBot)
        util function for creating a Cone geometry
      • makeCylinder

        public GeometryPtr makeCylinder​(float radius,
                                        float height)
        util function for creating a Cylinder geometry
      • makeGrid

        public GeometryPtr makeGrid​(int dim_x,
                                    int dim_y,
                                    double size_x,
                                    double size_y,
                                    Vector3D xdir,
                                    Vector3D ydir)
        Construct a grid.
        Parameters:
        dim_x - [in] number of cells in first direction.
        dim_y - [in] number of cells in second direction.
        size_x - [in] size of one cell.
        size_y - [in] size of one cell.
        xdir - [in] the direction of the first dimension.
        ydir - [in] the direction of the second dimension.
        Returns:
        a new grid geometry.
      • makeGrid

        public GeometryPtr makeGrid​(int dim_x,
                                    int dim_y,
                                    double size_x,
                                    double size_y,
                                    Vector3D xdir)
        Construct a grid.
        Parameters:
        dim_x - [in] number of cells in first direction.
        dim_y - [in] number of cells in second direction.
        size_x - [in] size of one cell.
        size_y - [in] size of one cell.
        xdir - [in] the direction of the first dimension.

        Returns:
        a new grid geometry.
      • makeGrid

        public GeometryPtr makeGrid​(int dim_x,
                                    int dim_y,
                                    double size_x,
                                    double size_y)
        Construct a grid.
        Parameters:
        dim_x - [in] number of cells in first direction.
        dim_y - [in] number of cells in second direction.
        size_x - [in] size of one cell.
        size_y - [in] size of one cell.


        Returns:
        a new grid geometry.
      • makeGrid

        public GeometryPtr makeGrid​(int dim_x,
                                    int dim_y,
                                    double size_x)
        Construct a grid.
        Parameters:
        dim_x - [in] number of cells in first direction.
        dim_y - [in] number of cells in second direction.
        size_x - [in] size of one cell.



        Returns:
        a new grid geometry.
      • makeGrid

        public GeometryPtr makeGrid​(int dim_x,
                                    int dim_y)
        Construct a grid.
        Parameters:
        dim_x - [in] number of cells in first direction.
        dim_y - [in] number of cells in second direction.




        Returns:
        a new grid geometry.
      • getColor

        public void getColor​(SWIGTYPE_p_float color)
        get the color stored for the object
        Parameters:
        color - [out] the array to store the color in