Wednesday, December 19, 2007

Datum planes where to launch the sketcher, mouse interactivity

Added to the drawing area the XYZ datum planes from where the user can select the plane where he will draw the shape with the sketcher.
Added mouse interactivity to the shapes drawn, the user can make operations like dynamic rotations.

Thursday, December 13, 2007

Drawn the coordinate system


Drawn an XYZ axis with labels using a trihedron shape, started working at repositioning/rescaling the drawing system when the application window is modified.
Changing the view to top, left, bottom etc. applies well on the displayed shapes.

Will continue with adding 3 datum planes on the XYZ axis and implement sectioning when the mouse is over a shape.

Tuesday, December 11, 2007

Added an OCAF Line driver



Adding an OCAF Line drawing driver and displaying the shape was similar with the Rectangle, it went quickly. Will continue with drawing the XYZ axis using the line shape and drawing the datum planes using the rectangle shape.

All the source codes were updated on Sourceforge.

Moved the development on a core2 computer. Will make some performance tests to see if OpenCascade scales properly on 2 cores.

Suceeded to draw a 3D rectangle


Finally succeeded to draw a 3D rectangle using TdataStd attributes form OCAF and generating with TNaming_Builder a TNaming_NamedShape. The topological shape was created by making Edges from Points, connected the Edges into an Wire and finally creating a Face from the Wire.

A very useful functionality for debugging was to add the DFBrowser functionality to the application used for displaying the OCAF label and attribute hierarchy.

Looked at Catia V5 usability, functionality and features. It looks very good. Easy to use and intuitive.

The next step in development will be to add a line drawing OCAF driver and draw XYZ axis and 3 datum planes (XY, YX,ZX).

Monday, December 10, 2007

The OCAF attribute TDataStd_Geometry

It seems that the TDataStd_Geometry attribute cannot be used consistently with the TDataStd_Real. If for the later to create/retrieve a child label with an attribute it is possible to say:

TDataStd_Real::Set(L.FindChild(1), x);

for TDataStd_Geometry such a method is not implemented. Creating an TDataStd_Geometry is made like this:

- setting a point on a label:
TDF_Label childLabel = L.FindChild(1);
TNaming_Builder B(childLabel);
B.Generated(BRepBuilderAPI_MakeVertex(xCoord));
Handle_TDataStd_Geometry geometry = TDataStd_Geometry::Set(childLabel);
geometry->SetType(TDataStd_POINT);

- retrieving the point:
Handle(TDataStd_Geometry) firstPointGeometry;
gp_Pnt firstPoint;
if (!Label().FindChild(1).FindAttribute(TDataStd_Geometry::GetID(), firstPointGeometry)) return 1;
firstPointGeometry->Point(Label().FindChild(1), firstPoint);