Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to use NatVis to display specific indexed members?

$
0
0

Hi,

my problem might be trivial, although i can't find a working solution. Let's say i want to visualize a structure with the following members:

template<int Dimension> class Vector
{
	double _Data[Dimension];
};

struct TwoVectors
{
	Vector<3> First;
	Vector<3> Second;
};


The default debug output is something like " .... _Data=0x1540c228 {263.2380, 15.1916, 87.2347} ..." for every Vector. What i try to get is an output with the following formatting:

"{first: [263.2380, 15.1916, 87.2347], second: [263.2380, 15.1916, 87.2347]}"

The most important aspect is to get all values in one line. Currently, we have to expand multiple tree items to reach the actual values.What i tried was the following notation, which, of course, didnt work, since the [] operator causes an error:

<Type Name="Namespace::TwoVectors"><DisplayString>{{ first:[{First[0]},{First[1]},{First[2]}], second:[{Second[0]},{Second[1]},{Second[2]}] }}</DisplayString>  </Type>

How can i achieve the desired output using NatVis?

Any help is very appreciated, thanks.



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>