0024812: Provide VS2012 debugger visualizer for OCCT types
authoragv <agv@opencascade.com>
Wed, 9 Apr 2014 08:13:20 +0000 (12:13 +0400)
committerapn <apn@opencascade.com>
Thu, 10 Apr 2014 15:21:13 +0000 (19:21 +0400)
.gitattributes
dox/dev_guides/debug/occt.natvis [new file with mode: 0644]

index 6f32bdc..d2ae005 100644 (file)
@@ -36,6 +36,7 @@
 *.rle       eol=lf
 *.vrml      eol=lf
 *.md        eol=lf
+*.natvis    eol=lf
 FILES       eol=lf
 PACKAGES    eol=lf
 EXTERNLIB   eol=lf
diff --git a/dox/dev_guides/debug/occt.natvis b/dox/dev_guides/debug/occt.natvis
new file mode 100644 (file)
index 0000000..c21ba55
--- /dev/null
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
+  <Type Name="gp_XY">
+    <DisplayString>[{(float)x} {(float)y}]</DisplayString>
+  </Type>
+  <Type Name="gp_Pnt2d">
+    <AlternativeType Name="gp_Vec2d"></AlternativeType>
+    <AlternativeType Name="gp_Dir2d"></AlternativeType>
+    <DisplayString>[{(float)cood.x} {(float)cood.y}]</DisplayString>
+  </Type>
+  <Type Name="gp_XYZ">
+    <DisplayString>[{(float)x} {(float)y} {(float)z}]</DisplayString>
+  </Type>
+  <Type Name="gp_Pnt">
+    <AlternativeType Name="gp_Vec"></AlternativeType>
+    <AlternativeType Name="gp_Dir"></AlternativeType>
+    <DisplayString>[{(float)coord.x} {(float)coord.y} {(float)coord.z}]</DisplayString>
+  </Type>
+  <Type Name="NCollection_Vec2&lt;*&gt;">
+    <DisplayString>[{v[0]} {v[1]}]</DisplayString>
+  </Type>
+  <Type Name="NCollection_Vec3&lt;*&gt;">
+    <DisplayString>[{v[0]} {v[1]} {v[2]}]</DisplayString>
+  </Type>
+  <Type Name="NCollection_Vec4&lt;*&gt;">
+    <DisplayString>[{v[0]} {v[1]} {v[2]} {v[3]}]</DisplayString>
+  </Type>
+  <Type Name="gp_Mat2d">
+    <DisplayString>
+      [{(float)matrix[0][0]} {(float)matrix[0][1]}], [{(float)matrix[1][0]} {(float)matrix[1][1]}]
+    </DisplayString>
+  </Type>
+  <Type Name="NCollection_Mat4&lt;*&gt;">
+    <Expand>
+      <Item Name="row0">((NCollection_Vec4&lt;$T1&gt;*)myMat)[0]</Item>
+      <Item Name="row1">((NCollection_Vec4&lt;$T1&gt;*)myMat)[1]</Item>
+      <Item Name="row2">((NCollection_Vec4&lt;$T1&gt;*)myMat)[2]</Item>
+      <Item Name="row3">((NCollection_Vec4&lt;$T1&gt;*)myMat)[3]</Item>
+    </Expand>
+  </Type>
+  <Type Name="Handle_Standard_Transient">
+    <DisplayString Condition="entity==0x00000000">NULL</DisplayString>
+    <DisplayString Condition="entity!=0x00000000">[count={entity->count}]</DisplayString>
+    <Expand>
+      <ExpandedItem>*entity</ExpandedItem>
+    </Expand>
+  </Type>
+  <Type Name="NCollection_Handle&lt;*&gt;">
+    <DisplayString Condition="entity==0x00000000">NULL</DisplayString>
+    <DisplayString Condition="entity!=0x00000000">[count={entity->count}]</DisplayString>
+    <Expand>
+      <ExpandedItem>*((NCollection_Handle&lt;$T1&gt;::Ptr*)entity)->myPtr</ExpandedItem>
+    </Expand>
+  </Type>
+  <Type Name="TCollection_AsciiString">
+    <DisplayString>{mylength}: {mystring,s}</DisplayString>
+  </Type>
+  <Type Name="TCollection_HAsciiString">
+    <DisplayString>{myString.mylength}: {myString.mystring,s}</DisplayString>
+  </Type>
+  <Type Name="NCollection_UtfString&lt;*&gt;">
+    <DisplayString>{myLength}: {myString,s}</DisplayString>
+  </Type>
+  <Type Name="TCollection_ExtendedString">
+    <DisplayString>{mylength}: {(wchar_t *)mystring,su}</DisplayString>
+  </Type>
+  <Type Name="TCollection_HExtendedString">
+    <DisplayString>{myString.mylength}: {(wchar_t *)myString.mystring,su}</DisplayString>
+  </Type>
+  <Type Name="TCollection_BaseSequence">
+    <DisplayString>TCollection_Sequence [{Size}], curr={CurrentIndex}</DisplayString>
+  </Type>
+  <Type Name="TCollection_BasicMap">
+    <AlternativeType Name="NCollection_BaseMap"/>
+    <DisplayString>TCollection_Map [{mySize}]</DisplayString>
+  </Type>
+  <Type Name="TColStd_PackedMapOfInteger">
+    <DisplayString>TColStd_PackedMapOfInteger [{myExtent}]</DisplayString>
+  </Type>
+  <Type Name="NCollection_Vector&lt;*&gt;">
+    <DisplayString>NCollection_Vector [{myLength}]</DisplayString>
+    <Expand>
+      <IndexListItems Condition="myData->Length&lt;myLength">
+        <Size>myData->Length</Size>
+        <ValueNode>*($T1*)((char*)myData->DataPtr + $i * myItemSize)</ValueNode>
+      </IndexListItems>
+      <IndexListItems Condition="myData->Length&gt;=myLength">
+        <Size>myLength</Size>
+        <ValueNode>*($T1*)((char*)myData->DataPtr + $i * myItemSize)</ValueNode>
+      </IndexListItems>
+    </Expand>
+  </Type>
+  <Type Name="NCollection_List&lt;*&gt;">
+    <DisplayString>NCollection_List [{myLength}]</DisplayString>
+    <Expand>
+      <LinkedListItems>
+        <Size>myLength</Size>
+        <HeadPointer>myFirst</HeadPointer>
+        <NextPointer>myNext</NextPointer>
+        <ValueNode>*($T1*)(sizeof(NCollection_ListNode) + ((char *)this))</ValueNode>
+      </LinkedListItems>
+    </Expand>
+  </Type>
+  <Type Name="Bnd_B2f">
+    <AlternativeType Name="Bnd_B2d"></AlternativeType>
+    <DisplayString Condition="myCenter[0] &gt; 1000000000000000000.">VOID</DisplayString>
+    <DisplayString Condition="myCenter[0] &lt; 1000000000000000000.">
+      Center: [{(float)myCenter[0]} {(float)myCenter[1]}], hSize: [{(float)myHSize[0]} {(float)myHSize[1]}]
+    </DisplayString>
+  </Type>
+  <Type Name="Bnd_B3f">
+    <AlternativeType Name="Bnd_B3d"></AlternativeType>
+    <DisplayString Condition="myCenter[0] &gt; 1000000000000000000.">VOID</DisplayString>
+    <DisplayString Condition="myCenter[0] &lt; 1000000000000000000.">
+      Center: [{(float)myCenter[0]} {(float)myCenter[1]} {(float)myCenter[2]}], hSize: [{(float)myHSize[0]} {(float)myHSize[1]} {(float)myHSize[2]}]
+    </DisplayString>
+  </Type>
+  <Type Name="TDF_Label">
+    <DisplayString Condition="myLabelNode==0">NULL</DisplayString>
+    <DisplayString Condition="myLabelNode!=0">[:{myLabelNode->myTag}]</DisplayString>
+    <Expand>
+      <ExpandedItem>*myLabelNode</ExpandedItem>
+    </Expand>
+  </Type>
+  <Type Name="TDF_LabelNode">
+    <DisplayString>[:{myTag}]</DisplayString>
+    <Expand>
+      <Item Name="brother" Condition="myBrother!=0">* myBrother</Item>
+      <Item Name="child" Condition="myFirstChild!=0">* myFirstChild</Item>
+      <ExpandedItem>myFirstAttribute</ExpandedItem>
+    </Expand>
+  </Type>
+  <Type Name="Handle_TDF_Attribute">
+    <DisplayString Condition="entity==0x00000000">NULL</DisplayString>
+    <DisplayString Condition="entity!=0x00000000">
+      [transaction={((TDF_Attribute*)entity)->myTransaction}]
+    </DisplayString>
+    <Expand>
+      <!--Item Name="next" Condition="myNext.entity!=0x00000000">myNext</Item-->
+      <ExpandedItem>(TDF_Attribute*)entity</ExpandedItem>
+    </Expand>
+  </Type>
+  <Type Name="OpenGl_Context">
+    <DisplayString>[{myGlVerMajor}.{myGlVerMinor}]</DisplayString>
+  </Type>
+</AutoVisualizer>