Advertisement
BurningBunny

PolygonMesh3D XML

Jun 24th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 4.15 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <PolygonMesh3D name="SimpleMesh">
  3.   <ArrayOfPolygon3D>
  4.     <Polygon3D>
  5.       <A>
  6.         <X>10</X>
  7.         <Y>10</Y>
  8.         <Z>0</Z>
  9.       </A>
  10.       <B>
  11.         <X>17</X>
  12.         <Y>12</Y>
  13.         <Z>0</Z>
  14.       </B>
  15.       <C>
  16.         <X>10</X>
  17.         <Y>12</Y>
  18.         <Z>0</Z>
  19.       </C>
  20.     </Polygon3D>
  21.     <Polygon3D>
  22.       <A>
  23.         <X>10</X>
  24.         <Y>10</Y>
  25.         <Z>0</Z>
  26.       </A>
  27.       <B>
  28.         <X>17</X>
  29.         <Y>12</Y>
  30.         <Z>0</Z>
  31.       </B>
  32.       <C>
  33.         <X>15</X>
  34.         <Y>8</Y>
  35.         <Z>0</Z>
  36.       </C>
  37.     </Polygon3D>
  38.     <Polygon3D>
  39.       <A>
  40.         <X>10</X>
  41.         <Y>10</Y>
  42.         <Z>0</Z>
  43.       </A>
  44.       <B>
  45.         <X>15</X>
  46.         <Y>8</Y>
  47.         <Z>0</Z>
  48.       </B>
  49.       <C>
  50.         <X>11</X>
  51.         <Y>6</Y>
  52.         <Z>0</Z>
  53.       </C>
  54.     </Polygon3D>
  55.   </ArrayOfPolygon3D>
  56. </PolygonMesh3D>
  57.  
  58.  
  59.  
  60.  
  61.  
  62. <?xml version="1.0" encoding="utf-8"?>
  63. <xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
  64.   <xsd:element name="PolygonMesh3D">
  65.     <xsd:complexType>
  66.       <xsd:sequence>
  67.         <xsd:element name="Polygons">
  68.           <xsd:complexType>
  69.             <xsd:sequence>
  70.               <xsd:element maxOccurs="unbounded" name="Polygon3D">
  71.                 <xsd:complexType>
  72.                   <xsd:sequence>
  73.                     <xsd:element name="A">
  74.                       <xsd:complexType>
  75.                         <xsd:sequence>
  76.                           <xsd:element name="X" type="xsd:byte" />
  77.                           <xsd:element name="Y" type="xsd:byte" />
  78.                           <xsd:element name="Z" type="xsd:byte" />
  79.                         </xsd:sequence>
  80.                       </xsd:complexType>
  81.                     </xsd:element>
  82.                     <xsd:element name="B">
  83.                       <xsd:complexType>
  84.                         <xsd:sequence>
  85.                           <xsd:element name="X" type="xsd:byte" />
  86.                           <xsd:element name="Y" type="xsd:byte" />
  87.                           <xsd:element name="Z" type="xsd:byte" />
  88.                         </xsd:sequence>
  89.                       </xsd:complexType>
  90.                     </xsd:element>
  91.                     <xsd:element name="C">
  92.                       <xsd:complexType>
  93.                         <xsd:sequence>
  94.                           <xsd:element name="X" type="xsd:byte" />
  95.                           <xsd:element name="Y" type="xsd:byte" />
  96.                           <xsd:element name="Z" type="xsd:byte" />
  97.                         </xsd:sequence>
  98.                       </xsd:complexType>
  99.                     </xsd:element>
  100.                   </xsd:sequence>
  101.                 </xsd:complexType>
  102.               </xsd:element>
  103.             </xsd:sequence>
  104.           </xsd:complexType>
  105.         </xsd:element>
  106.       </xsd:sequence>
  107.     </xsd:complexType>
  108.   </xsd:element>
  109. </xs:schema>
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.         public class Point3D
  119.         {
  120.             public Point3D() { }
  121.             public Point3D(int x,int y,int z) { X = x; Y = y; Z = z; }
  122.             public int X { get; set; }
  123.             public int Y { get; set; }
  124.             public int Z { get; set; }         
  125.         }
  126.        
  127.         public class Line3D
  128.         {
  129.             public Line3D() { }
  130.             public Line3D(Point3D origin,Point3D endpoint) { Origin=origin; EndPoint=endpoint; }
  131.             public Point3D Origin { get; set; }
  132.             public Point3D EndPoint { get; set; }
  133.         }
  134.        
  135.         public class Polygon3D
  136.         {
  137.             public Polygon3D() { }
  138.             public Polygon3D(Point3D a,Point3D b,Point3D c) { A=a; B=b; C=c; }         
  139.             public Point3D A { get; set; }
  140.             public Point3D B { get; set; }
  141.             public Point3D C { get; set; }
  142.             public Line3D LineAB { get { return new Line3D(A,B); } }
  143.             public Line3D LineBC { get { return new Line3D(B,C); } }
  144.             public Line3D LineCA { get { return new Line3D(C,A); } }
  145.         }
  146.        
  147.         public class PolygonMesh3D
  148.         {   public PolygonMesh3D() { }
  149.             public PolygonMesh3D(List<Polygon3D> polygons) { Polygons=polygons; }
  150.             public List<Polygon3D> Polygons = new List<Polygon3D>();           
  151.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement