Hello,
for example
[DllImport("OCasToDotNet.dll")] [SuppressUnmanagedCodeSecurity]
private static extern IntPtr BRepMesh_ShapeTool_FirstVertex_17(IntPtr E);
///
///if there is not first vertex (semi-infinite edge)
///
public static TopoDS_Vertex FirstVertex(TopoDS_Edge E)
{
try
{
TopoDS_Vertex _res = Handle.Create(BRepMesh_ShapeTool_FirstVertex_17(E)) as TopoDS_Vertex;
return _res;
}
catch (SEHException)
{
throw new OpenCascade.Exception();
}
catch (AccessViolationException)
{
throw new OpenCascade.Exception("Access violation in OpenCascade");
}
}
[DllImport("OCasToDotNet.dll")] [SuppressUnmanagedCodeSecurity]
private static extern IntPtr BRepMesh_ShapeTool_LastVertex_18(IntPtr E);
///
///if there is not last vertex (semi-infinite edge)
///
public static TopoDS_Vertex LastVertex(TopoDS_Edge E)
{
try
{
TopoDS_Vertex _res = Handle.Create(BRepMesh_ShapeTool_LastVertex_18(E)) as TopoDS_Vertex;
return _res;
}
catch (SEHException)
{
throw new OpenCascade.Exception();
}
catch (AccessViolationException)
{
throw new OpenCascade.Exception("Access violation in OpenCascade");
}
}
and the corresponding C++ Code is:
OCASTOCSHARP_API CTopoDS_Vertex *CALLING_CONVENTION BRepMesh_ShapeTool_FirstVertex_17(CTopoDS_Edge * E)
{
CTopoDS_Vertex *_res = CTopoDS_Vertex::Create(BRepMesh_ShapeTool::FirstVertex(E->GetData()),(CHandle *)NULL);
return _res;
}
OCASTOCSHARP_API CTopoDS_Vertex *CALLING_CONVENTION BRepMesh_ShapeTool_LastVertex_18(CTopoDS_Edge * E)
{
CTopoDS_Vertex *_res = CTopoDS_Vertex::Create(BRepMesh_ShapeTool::LastVertex(E->GetData()),(CHandle *)NULL);
return _res;
}
I hope everything appears well formatted in this message. But it is ofcourse alot more that you need to know. I generated everything automatically from the cdl files and you may use the wrapper for free (look at the open source community)
best regards
Commenter-1