Input/output
boolean getCoord (long ctxt, String prompt, float[] coord);
Displays the coordinate entry dialogue box. The prompt is displayed on the title of dialogue box. Returns zero if user pressed cancel and positive value if user pressed OK button.
boolean getLength (long ctxt, String prompt, float[] length);
Displays the length value entry dialogue box. The prompt is displayed on the title of dialogue box. Returns zero if user pressed cancel and positive value if user pressed OK button. Length value is interpreted according the current length units.
boolean getValue (long ctxt, String prompt, float[] value);
Displays the float value entry dialogue box. The prompt is displayed on the title of dialogue box. Returns zero if user pressed cancel and positive value if user pressed OK button.
traceMessage (String str);
Outputs the text message into the bCAD trace window.
WARNING! The primary aim of that call is to provide developer with ability to print debugging information. It is generally not recommended to use that call for printing user related information.
Editor settings
int fixState (long ctxt);
Stores current state of the drawing into the UNDO buffer. All changes between two calls of fixState can be reversed by single UNDO command.
HoldEditor (long ctxt);
Stores current state of the editor.
FetchEditor (long ctxt);
Restores current state of the editor.
int setColor (long ctxt, int newcolor);
Sets current colour for wire-frame display. Returns new colour value.
float setLineWidth (long ctxt, float newLineWidth);
Sets current line width for wire-frame objects. Returns new value.
int setLinePattern (long ctxt, String pattName);
Not released yet.
int createLayer (long ctxt, String layerName);
Creates a new layer with specified name. Returns negative value as bad result.
int setLayer (long ctxt, String layerName);
Sets layer with specified name as current.
Objects creation
Wire-frame and 3D entities creation calls return either negative value as a bad result or a new object unique identifier-number as a successful result.
Wire-frame entities
int createLine (long ctxt, float[] start, float[] end);
Draws a straight line with specified coordinates of the start and end points.
int createLineP (long ctxt, float[] start, float length, float[] first, float[] second);
Draws the line with specified length which goes from the start point and perpendicular to the vector, specified by its first and second points.
int createLineO (long ctxt, float[] start, float length, float[] first, float[] second);
Draws the line with specified length which goes from the start point and orthogonal to the vector, specified by its first and second points.
int createPLine (long ctxt, float[] triples);
Draws the sequence of straight segments, connected into the single object polyline.
int createRect (long ctxt, float[] corner, float width, float height)
Draws the rectangular polygon by specified corner point and rectangle width and height values.
int createRegularP (long ctxt, float[] centre, float radius, float bias, int segments);
Draws the regular polygon by specified centre point radius of the circle, new polygon must fit in, bias angle an number of segments.
int createCircleA (long ctxt, float[] c, float radius);
Draws the circle by specified centre point and circle radius.
int createCircleB (long ctxt, float[] v0, float[] v1, float[] v2);
Draws the circle, which goes through the specified three vertices.
int createEllipse (long ctxt, float[] c, float r1, float r2, float bias);
Draws the ellipse by specified centre point, two radiuses and bias angle
int createArcA (long ctxt, float[] centre, float radius, float as, float ae);
Draws the circular arc by specified centre point, arc radius, start and end angle.
int createText2D (long ctxt, float[] s, String text);
Draws the 2D text by left down corner and text string value (UNICODE).
3D Surface entities
int createPlane (long ctxt, float[] s, float w, float h, int wN, int hN);
Draws the flat rectangular plane by corner, width, height and mesh accuracy in width and height directions.
int create4Corner (long ctxt, float[] c0, float[] c1, float[] c2, float[] c3, int M, int N);
Creates the regular 3D mesh surface by specified four corner vertices and mesh accuracy in M ( from vertex c0 to vertex c1 ) and N ( from vertex c0 to vertex c1 ) directions.
int createBox (long ctxt, float[] s, float w, float h, float d, int wN, int hN, int dN);
Creates the parallelogramm box by specified corner, width, height and depth values, and mesh accuracy in width, height and depth directions.
int createTorus (long ctxt, float[] s, float r0, float r1, int M, int N);
Creates the round torus surface by specified centre, torus radius, tube radius and mesh accuracy in M (longitudinal) and N (latitudinal ) directions.
int createSphere (long ctxt, float[] s, float r, int M, int N);
Creates the sphere surface by specified centre, radius and mesh accuracy in M (longitudinal) and N (latitudinal ) directions.
int createDome (long ctxt, float[] s, float r, int M, int N, int cap);
Creates the spherical dome surface by specified centre, radius and mesh accuracy in M (longitudinal) and N (latitudinal ) directions
int createDish (long ctxt, float[] s, float r, int M, int N, int cap);
Creates the spherical dome surface by specified centre, radius and mesh accuracy in M (longitudinal) and N (latitudinal ) directions
int createCone (long ctxt, float[] s, float [] e, float rs, float re, int cs, int ce, int N);
Creates the round truncated cone surface by specified centre of the bottom, centre of the top, radius of the bottom, radius of the top, and mesh accuracy. You also can specify are bottom (cs flag) and top (ce flag) created r not.
int createMesh (long ctxt, float[] s, int M, int N);
Creates a regular mesh surface by array of the vertices and mesh accuracy in M and N directions. The number of the vertices in the array must be exactly MxN.
int createSurface (long ctxt, float[] vert, int[] tria, int[] attr);
Creates an irregular mesh surface by array of the vertices, array of the triangle faces and array of edges visibility flags. Each element in the array of the triangle faces is triad of the vertices indexes in the array of vertices. Visibility flags !!!!!!
int createRevolve (long ctxt, float[] contour, float[] axis_start, float[] axis_end, float start, float angle, int N);
Creates the surface of revolution by contour, axis start point, axis end point, start angle, angle of revolution and accuracy of the mesh N.
Cameras and lights
int createSpot (long ctxt, float[] sou, float[] tag, float hotspot, float falloff, float[] rgb);
Creates the spot light object by light position sou, light target tag, hotspot angle, falloff angle and rgb colour of the light. Colour is defined as a triad of red, green and blue components.
int createOmni (long ctxt, float[] sou, float[] rgb);
Creates the omni-directional light object by light position sou and rgb colour of the light. Colour is defined as a triad of red, green and blue components.
int createCamera (long ctxt, float[] sou, float[] tag, float[] up, float angle, float[] sPath, float[] tPath, int frames);
Creates the animated camera object by camera position sou, camera target tag, camera towards direction up, camera position path sPath, target position path tPath and number of the frames.