#140=ADVANCED_FACE('',(#184),#97,.T.);
#97=(BOUNDED_SURFACE()B_SPLINE_SURFACE(3,3,((#1023,#1024,#1025,#1026),(#1027,#1028,#1029,#1030),(#1031,#1032,#1033,#1034),(#1035,#1036,#1037,#1038)),.UNSPECIFIED.,.F.,.F., .F.)B_SPLINE_SURFACE_WITH_KNOTS((4,4),(4,4),(0.,1.),(0.,1.),.UNSPECIFIED.)GEOMETRIC_REPRESENTATION_ITEM()RATIONAL_B_SPLINE_SURFACE(((1.,0.949253021674191,0.949253021674191,1.),(0.804737854124365,0.763899839683158,0.763899839683158,0.804737854124365),(0.804737854124365,0.763899839683158,0.763899839683158,0.804737854124365),(1.,0.949253021674191,0.949253021674191,1.)))REPRESENTATION_ITEM('')SURFACE());SdaiAdvanced_face *adv_face = ...; //#140
SdaiSurface_ptr surfPtr = adv_face->face_geometry_();std::string ent_name = surfPtr->eDesc->Name(); // I got "B_Spline_Surface"
SdaiB_spline_surface* b_spline_surf = dynamic_cast<SdaiB_spline_surface *>(surfPtr);
--
You received this message because you are subscribed to the Google Groups "STEPcode - Developers Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scl-dev+u...@googlegroups.com.
To post to this group, send email to scl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scl-dev/67a880e7-25d7-4e13-828f-bf5fae29cea5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
#include "stdafx.h"
#include <string>
#include <STEPfile.h>
#include <STEPComplex.h>
#include <SdaiCONFIG_CONTROL_DESIGN.h>
int _tmain(int argc, _TCHAR* argv[])
{
InstMgr *instance_list;
Registry *registry;
STEPfile *sfile;
instance_list = new InstMgr();
registry = new Registry(SchemaInit);
sfile = new STEPfile(*registry, *instance_list);
std::string filename = "skrugl2.stp";
if (sfile->ReadExchangeFile(filename)<SEVERITY_WARNING) {
const ErrorDescriptor SCLError=sfile->Error();
printf("%s\n",SCLError.UserMsg());
printf("Details:(%s)\n",SCLError.DetailMsg());
return -1;
}
//Find our entity
auto Ent = instance_list->GetSTEPentity(140);
SdaiAdvanced_face* adv_face = (SdaiAdvanced_face*)Ent;
SdaiSurface_ptr surf_ptr = (SdaiSurface_ptr)adv_face->face_geometry_();
std::string ent_name = surf_ptr->eDesc->Name(); // I got "B_Spline_Surface"
bool isComplex = (bool)surf_ptr->IsComplex();
if (isComplex)
{
auto sc = ( ( STEPcomplex * )surf_ptr )->head;
//Now I can parse all sub-entities...
while (sc)
{
sc->ResetAttributes();
std::string sc_name = sc->eDesc->Name();
if ( sc->IsA(config_control_design::e_b_spline_surface) )
{
auto _instPtr = sc->eDesc->NewSTEPentity();
//SdaiB_spline_surface* b_spl_surfPtr1 = (SdaiB_spline_surface*)sc->eDesc->NewSTEPentity(); //WRONG
//SdaiB_spline_surface* b_spl_surfPtr2 = (SdaiB_spline_surface*)sc; //WRONG
}
//... and all the attributes
STEPattribute * attr;
while (attr = sc->NextAttribute())
{
std::string atrName = attr->aDesc->Name();
auto atrTypeName = attr->TypeName();
unsigned int u_degree = 0;
if (atrName=="u_degree")
{
u_degree = *attr->ptr.i;
}
}
sc = sc->sc;
}
}
delete instance_list;
delete registry;
delete sfile;
return 0;
}
--
You received this message because you are subscribed to the Google Groups "STEPcode - Developers Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scl-dev+u...@googlegroups.com.
To post to this group, send email to scl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scl-dev/f36d3eca-9d46-4cc1-8857-870f48701a81%40googlegroups.com.