コード例 #1
0
ファイル: BrepHandler.cpp プロジェクト: cciechad/brlcad
  void
  BrepHandler::extractFace(const DirectoryEntry* de, bool orientWithSurface) {
    // spec says the surface can be:
    //   parametric spline surface
    //   ruled surface
    //   surface of revolution
    //   tabulated cylinder
    //   rational b-spline surface
    //   offset surface
    //   plane surface
    //   rccyl surface
    //   rccone surface
    //   spherical surface
    //   toroidal surface

    debug("########################## E X T R A C T   F A C E");
    ParameterData params;
    _iges->getParameter(de->paramData(), params);

    Pointer surfaceDE = params.getPointer(1);
    int surf = extractSurface(_iges->getDirectoryEntry(surfaceDE));

    int face = handleFace(orientWithSurface, surf);

    int numLoops = params.getInteger(2);
    bool isOuter = params.getLogical(3) || true; // outer is not set in IGES from Pro/E!
    for (int i = 4; (i-4) < numLoops; i++) {
      Pointer loopDE = params.getPointer(i);
      extractLoop(_iges->getDirectoryEntry(loopDE), isOuter, face);
      isOuter = false;
    }
  }
コード例 #2
0
ファイル: BrepHandler.cpp プロジェクト: cciechad/brlcad
  void
  BrepHandler::extractBrep(const DirectoryEntry* de) {
    debug("########################### E X T R A C T   B R E P");
    ParameterData params;
    _iges->getParameter(de->paramData(), params);

    Pointer shell = params.getPointer(1);
    extractShell(_iges->getDirectoryEntry(shell), false, params.getLogical(2));
    int numVoids = params.getInteger(3);

    if (numVoids <= 0) return;

    int index = 4;
    for (int i = 0; i < numVoids; i++) {
      shell = params.getPointer(index);
      extractShell(_iges->getDirectoryEntry(shell),
		   true,
		   params.getLogical(index+1));
      index += 2;
    }
  }
コード例 #3
0
ファイル: BrepHandler.cpp プロジェクト: cciechad/brlcad
  int
  BrepHandler::extractLoop(const DirectoryEntry* de, bool isOuter, int face) {
    debug("########################## E X T R A C T   L O O P");
    ParameterData params;
    _iges->getParameter(de->paramData(), params);

    int loop = handleLoop(isOuter, face);
    int numberOfEdges = params.getInteger(1);

    int i = 2; // extract the edge uses!
    for (int _i = 0; _i < numberOfEdges; _i++) {
      bool isVertex = (1 == params.getInteger(i)) ? true : false;
      Pointer edgePtr = params.getPointer(i+1);
      int index = params.getInteger(i+2);
      // need to get the edge list, and extract the edge info
      int edge = extractEdge(_iges->getDirectoryEntry(edgePtr), index);
      bool orientWithCurve = params.getLogical(i+3);

      // handle this edge
      handleEdgeUse(edge, orientWithCurve);

      // deal with param-space curves (not generally included in Pro/E output)
      int numCurves = params.getInteger(i+4);
      int j = i+5;
      list<PSpaceCurve> pCurveIndices;
      for (int _j = 0; _j < numCurves; _j++) {
	// handle the param-space curves, which are generally not included in MSBO
	Logical iso = params.getLogical(j);
	Pointer ptr = params.getPointer(j+1);
	pCurveIndices.push_back(PSpaceCurve(_iges,
					    this,
					    iso,
					    ptr));
	j += 2;
      }
      i = j;
    }
    return loop;
  }
コード例 #4
0
ファイル: BrepHandler.cpp プロジェクト: cciechad/brlcad
  void
  BrepHandler::extractShell(const DirectoryEntry* de, bool isVoid, bool orientWithFace) {
    debug("########################### E X T R A C T   S H E L L");
    ParameterData params;
    _iges->getParameter(de->paramData(), params);

    handleShell(isVoid, orientWithFace);

    int numFaces = params.getInteger(1);
    for (int i = 1; i <= numFaces; i++) {
      Pointer facePtr = params.getPointer(i*2);
      bool orientWithSurface = params.getLogical(i*2+1);
      DirectoryEntry* faceDE = _iges->getDirectoryEntry(facePtr);
      extractFace(faceDE, orientWithSurface);
    }
  }