Пример #1
0
 protected FileSegment(ByteReader reader, TocEntry entry, int version)
     : this()
 {
     // Postion the file stream:
     reader.Position = (long)entry.SegmentOffset;
     // Read the segment header:
     Header.Read(reader);
     //Read(reader, version);
 }
Пример #2
0
 public LogicalSceneGraph(ByteReader reader, TocEntry entry, int version)
     : base(reader, entry, version)
 {
     Properties = new List<Element>();
     PropertyTable = new PropertyTable();
 }
Пример #3
0
 private void ReadSegmentV9(TocEntry entry)
 {
     var seg = FileSegment.Create(reader, entry, 9);
     segments.Add(entry.SegmentID, seg);
 }
Пример #4
0
 public static FileSegment Create(ByteReader reader, TocEntry entry, int version=10)
 {
     FileSegment result = null;
     SegmentType segType = (SegmentType)( entry.SegmentAttributes >> 24 );
     switch (segType) {
         case SegmentType.LogicalSceneGraph:
             Console.WriteLine("Reading Logical Scene Graph Segment...");
             result = new LogicalSceneGraph(reader, entry, version);
             break;
         case SegmentType.JT_BRep:
             Console.WriteLine( "Reading JT Brep Segment..." );
             break;
         case SegmentType.PMI_Data:
             Console.WriteLine( "Reading PMI Data Segment..." );
             break;
         case SegmentType.MetaData:
             Console.WriteLine( "Reading Meta Data Segment..." );
             result = new MetaDataSegment(reader, entry, version);
             break;
         case SegmentType.Shape:
             Console.WriteLine( "Reading Shape Segment..." );
             break;
         case SegmentType.ShapeLOD0:
             Console.WriteLine( "Reading Shape LOD 0 Segment..." );
             result = new ShapeLodSegment(reader, entry, version);
             break;
         case SegmentType.ShapeLOD1:
             Console.WriteLine( "Reading Shape LOD 1 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD2:
             Console.WriteLine( "Reading Shape LOD 2 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD3:
             Console.WriteLine( "Reading Shape LOD 3 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD4:
             Console.WriteLine( "Reading Shape LOD 4 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD5:
             Console.WriteLine( "Reading Shape LOD 5 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD6:
             Console.WriteLine( "Reading Shape LOD 6 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD7:
             Console.WriteLine( "Reading Shape LOD 7 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD8:
             Console.WriteLine( "Reading Shape LOD 8 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.ShapeLOD9:
             Console.WriteLine( "Reading Shape LOD 9 Segment..." );
             result = new ShapeLodSegment( reader, entry, version );
             break;
         case SegmentType.XT_BRep:
             Console.WriteLine( "Reading XT Brep Segment..." );
             break;
         case SegmentType.WireframeRepresentation:
             Console.WriteLine( "Reading Wireframe Representation Segment..." );
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
     if (result != null) {
         result.Read(reader, version);
     }
     return result;
 }
Пример #5
0
 public ShapeLodSegment(ByteReader reader, TocEntry entry, int version)
     : base(reader, entry, version)
 {
     Read(reader, version);
 }
Пример #6
0
 public MetaDataSegment(ByteReader reader, TocEntry entry, int version)
     : base(reader, entry, version)
 {
 }