/*
This work is part of the Core Imaging Library developed by
Visual Analytics and Imaging System Group of the Science Technology
Facilities Council, STFC

Copyright 2003 Hamish Carr
Copyright 2017 Srikanth Nagella, Edoardo Pasca

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

//	Simplified Flexible Isosurfaces

//	Hamish Carr, 2003



//	Supernode.h:		class representing supernodes in contour tree



#ifndef SUPERNODE_H

#define SUPERNODE_H



//	include superarc, so we can get a couple of constants from it

#include "Superarc.h"



//	class representing a supernode in the contour tree

class Supernode

	{ // class Supernode

	public:

	//	pointers to lists of up- and down- arcs

	long upList, downList;					

	//	degree of node

	long upDegree, downDegree;

	//	pointer to the corresponding spatial sample

	float *value;

	//	and position for drawing

	float xPosn, yPosn;

	//	index into list of valid nodes

	long valid_index;

	//	the colour to use for this edge

	short colour;



	//	Initializer

	void Initialize(float *theValue);

	

	//	functions to test whether a node is a leaf, &c.

	bool IsUpperLeaf();

	bool IsLowerLeaf();

	bool IsRegular();

	}; // class Supernode



#endif

