]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/src-java-test/org/jcae/opencascade/jni/STEPLabel.java
Include old 64-bit versions of org.jcae.opencascade and vtk bundles
[simantics/3d.git] / org.jcae.opencascade / src-java-test / org / jcae / opencascade / jni / STEPLabel.java
1 /*
2  * Project Info:  http://jcae.sourceforge.net
3  * 
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation; either version 2.1 of the License, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17  *
18  * (C) Copyright 2008, by EADS France
19  */
20
21 package org.jcae.opencascade.jni;
22
23 import java.io.File;
24
25 import static org.junit.Assert.*;
26 import org.junit.Test;
27
28 /**
29  * Example which dump the label from the edges of a STEP file
30  * @author Jerome Robert
31  */
32 public class STEPLabel
33 {
34         @Test public void reader()
35         {
36                 String testDir = System.getProperty("test.dir", "test");
37                 String file = testDir + File.separator + "input" + File.separator + "cube.stp";
38                 STEPControl_Reader aReader = new STEPControl_Reader();
39                 aReader.readFile(file.getBytes());
40                 aReader.nbRootsForTransfer();
41                 aReader.transferRoots();
42                 TopoDS_Shape s = aReader.oneShape();
43                 TopExp_Explorer ex = new TopExp_Explorer(s, TopAbs_ShapeEnum.EDGE);
44                 int i = 0;
45                 while(ex.more())
46                 {
47                         i++;
48                         System.out.println(i+ " " + aReader.getLabel(ex.current()));
49                         ex.next();
50                 }
51         }
52 }