/*
 *
 * 		Shell Spiral SOP
 * 		
 * 		Deborah R. Fowler
 * 		Date: Dec 16, 2012
 *
 * 		HDK sop node to create a helico-spiral 
 *
 *		inspired by cmiVFX's David Garry tutorial on vex (201?)
 * 		based on 1992 Siggraph paper and C implementation code (1990's)
 *
 */

#ifndef __sopShellSpiral_h__
#define __sopShellSpiral_h__

#include <SOP/SOP_Node.h>

namespace HDK_Sample {
	const float PI 		= 3.141592653589;

	class sopShellSpiral : public SOP_Node
	{
		public:

			static OP_Node              *myConstructor(OP_Network*, const char *, OP_Operator *);
			static PRM_Template          myTemplateList[];
			static CH_LocalVariable      myVariables[];
			

		protected:

			sopShellSpiral(OP_Network *net, const char *name, OP_Operator *op);
			virtual ~sopShellSpiral();
			virtual unsigned             disableParms();
			virtual OP_ERROR             cookMySop(OP_Context &context);
			virtual float                getVariableValue(int index, int thread);

			float makedivisions( int ptnum );
			void makespiral();
			void polarToCartesian();

		private:
			int 	myCurrPoint;
			int		myTotalPoints;
			// Declare these variable in the class for easy access
			int ptnum;
			int numPoints;
			int numTurns;
			int divisions;
			float radiusInit;
			float radiusGrowth;
			float verticalInit;
			float verticalGrowth;
			float scaleInit;
			float scaleGrowth;
			float scale, theta, radius, vertical;
			float x,y,z;
			float nx,ny,nz;

	};

};

#endif
