NaroCAD has an installer script on SVN. It is based by InnoSetup, it require to you to have preinstalled the following components:
- .NET 3.5 SP1
- Visual C++ 2008 SP1 Redistributable Runtime
- OpenCascade (that may be downloaded from the www.opencascade.org
after you create a new account to your site)
Requirements: Windows XP SP2 or newer, Windows Vista or Windows 7 beta.
Download it from here
This installer may make easier to test in future NaroCAD and is pretty small (4.5 MB).
As the code will need some reorganization, the code is lightly cleanup. The schemas that enforce the data access were moved from function-drivers component to outside so any other component may use the schemas to not access wrong data.
How does a schema work? A schema will set a list of children and attributes. The children are numeric, and the attributes are a string from predefined sets.
So how is defined a schema that defines a line? It is defined as a two-point schema, the first is kept in child 1, the other one in child 2. The code is as following:
public class LineSchema : DescriptionSchema
public LineSchema() : base("Line")
How is used in our OCAF driver that define a line?
public class Line : DriverSimple
public Line() : base(2)
schema = SchemaFactory.GetSchema("Line");
public override OCTopoDS_Shape Execute()
// Get the values of dimension and position attributes
OCgp_Pnt firstPoint = schema.Root.Child(1).Geometry;
OCgp_Pnt secondPoint = schema.Root.Child(2).Geometry;
OCTopoDS_Edge aEdge = new OCBRepBuilderAPI_MakeEdge(firstPoint, secondPoint).Edge();
return new OCBRepBuilderAPI_MakeWire(aEdge).Wire();
This code will clean your code that was accessing your OCAF tree, it also guarantees that you will not read outside of that 2 points (or depending on your schema, the type of geometry you want to access), or reading other attributes that are not defined!