DrawElements.kl

Types

DrawElements (object)

The DrawElements allows to define a simple mix of points, lines and triangles for debug drawing purposes.

Members

GeometryAttributes attributes Container for all attributes.
String debugName Name that will be printed in descriptions.
UInt32 structureVersion Version of the geometry structure itself, excluding the GeometryAttributes content.
Boolean computeGPUBoundingVolume If positions are on the GPU: if true, the bounding volume is computed, else an infinite bbox is returned.
ThreadsafeMetaDataContainer metaData Container for holding various user data (Geometry specific), such as the BoundingBox cache data, or raycast acceleration structures and data (Octree).
Scalar pointSize Point size in pixels
Scalar lineWidth Line width in pixels
/*
** Example: DrawElements
*/

require Geometry;
  
operator entry() {

      DrawElements elements('debug');
      
      // draw a couple of points
      elements.drawPoint(Vec3(5, 0, 0));
      elements.drawPoint(Vec3(0, 5, 0));
      elements.drawPoint(Vec3(0, 0, 5));
      
      // draw a couple of lines
      elements.drawLine(Vec3(0, 0, 0), Vec3(5, 0, 0));
      elements.drawLine(Vec3(0, 0, 0), Vec3(0, 5, 0));
      elements.drawLine(Vec3(0, 0, 0), Vec3(0, 0, 5));
      
      // for more methods check the method description below.
  
}

/*
** Output:


*/

Methods

  DrawElements ( in DrawElements other )
  DrawElements ( in String name )
  DrawElements ()
Index allocateLines ! ( in Size nbPoints, in Size nbLines )
Index allocatePoints ! ( in Size nbPoints )
Index allocateTriangles ! ( in Size nbPoints, in Size nbTriangles )
Index allocateVertices ! ( in Size nbVertices )
  clear ! ()
DrawElements clone ? ()
  cloneMembersTo ? ( io DrawElements that )
  copy ! ( in DrawElements src )
  copy ! ( in Geometry src )
  disablePen ! ()
DrawElements drawArc ! ( in Xfo xfo, in Scalar radius, in Vec2 angleMinMax, in UInt32 detail )
DrawElements drawAxes ! ( in Xfo xfo, in Boolean bothSides )
DrawElements drawBBox ! ( in Xfo xfo, in Vec3 bboxmin, in Vec3 bboxmax )
DrawElements drawCapsuleLines ! ( in Xfo xfo, in Scalar radius, in Scalar height, in UInt32 detail )
DrawElements drawCircle ! ( in Xfo xfo, in Scalar radius, in UInt32 detail )
DrawElements drawLine ! ( in Vec3 from, in Vec3 to )
DrawElements drawLineStrip ! ( in Vec3 points[] )
DrawElements drawPoint ! ( in Vec3 pos )
DrawElements drawSegmentedLine ! ( in Vec3 from, in Vec3 to, in Size numSegments )
DrawElements drawSegmentedLine ! ( in Vec3 from, in Vec3 to, in Size numSegments, in Scalar ratio )
DrawElements drawSphereLines ! ( in Xfo xfo, in Scalar radius, in UInt32 detail )
DrawElements drawSquare ! ( in Xfo xfo, in Scalar length, in Scalar width )
DrawElements drawTriangle ! ( in Vec3 p0, in Vec3 p1, in Vec3 p2 )
DrawElements drawTriangle ! ( in Vec3 p0, in Vec3 p1, in Vec3 p2, in Vec3 n )
DrawElements drawTriangle ! ( in Vec3 p0, in Vec3 p1, in Vec3 p2, in Vec3 n0, in Vec3 n1, in Vec3 n2 )
DrawElements drawTrianglesCone ! ( in Xfo xfo, in Scalar radius, in Scalar height, in UInt32 detail )
DrawElements drawTrianglesCube ! ( in Xfo xfo, in Scalar width, in Scalar height, in Scalar length )
DrawElements drawTrianglesPlane ! ( in Xfo xfo, in Scalar width, in Scalar height )
DrawElements drawTrianglesSphere ! ( in Xfo xfo, in Scalar radius, in UInt32 detail )
Size elementCount ? ()
Ref<GeometryAttributes> getAttributes ? ()
LocalBoundingVolume getBoundingVolume ? ()
String getDebugName ? ()
String getDesc ? ( in Boolean withAttributes, in Boolean useUnitTestPrint )
LocalBoundingVolume getElementBoundingVolume ? ( in Size index )
Scalar getLineWidth ? ()
Ref<ThreadsafeMetaDataContainer> getMetaData ? ()
Vec3 getPointPosition ? ( in Size point )
Scalar getPointSize ? ()
UInt32 getStructureVersion ? ()
UInt32 getVersion ? ()
  init ! ( in String name )
  reset ! ()
  setLineWidth ! ( in Scalar value )
  setPen ! ( in Color color )
  setPointPosition ! ( in Size point, in Vec3 position )
  setPointSize ! ( in Scalar value )