/*******************************************************************************
 *  Copyright 2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * 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.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.templates.coloncadsriodtemplates;

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.enums.EnumContinuityOfContent;
import cdac.medinfo.sdk.dcm30_04.enums.EnumGraphicType;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CADGeometrySecondaryGraphicalRepresentation_CID6166;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CADGeometrySecondaryGraphicalRepresentation;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ColonCADGeometry;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ColonCADGeometry;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents ColonCADGeometry_TID4129 
 */
 public class ColonCADGeometry_TID4129 extends Template{

	/**
	 * Object of CADGeometrySecondaryGraphicalRepresentation_CID6166
	 */
	private CADGeometrySecondaryGraphicalRepresentation_CID6166 objCADGeometrySecondaryGraphicalRepresentationCID6166;

	private EnumGraphicType enumGraphicType;
	
	/**
	 * Instantiates ColonCADGeometry_TID4129 Template.
	 * @param objTree Object of SRTree.
	 */
	public ColonCADGeometry_TID4129(SRTree objTree)
	{
		super(objTree);
	}

	/**
	 * Sets the value for Center"Outline
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent 
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 * @param arrFlGraphicData 
	 */
	public void setCenter(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent, float[] arrFlGraphicData)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ColonCADGeometry.CENTER.getValue();
		String strCodeValue = EnumCV_ColonCADGeometry.CENTER_111010.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type SCOORD and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createSCOORDNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, arrFlGraphicData, enumGraphicType);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Outline
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent 
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 * @param arrFlGraphicData 
	 */
	public void setOutline(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent, float[] arrFlGraphicData)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ColonCADGeometry.OUTLINE.getValue();
		String strCodeValue = EnumCV_ColonCADGeometry.OUTLINE_111041.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type SCOORD and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createSCOORDNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, arrFlGraphicData, enumGraphicType);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Outline
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCADGeometrySecondaryGraphicalRepresentation Enumerated value for CADGeometrySecondaryGraphicalRepresentation
	 * @param arrFlGraphicData 
	 */
	public void setOutline(int[] arrPosition, EnumCM_CADGeometrySecondaryGraphicalRepresentation enumCADGeometrySecondaryGraphicalRepresentation, float[] arrFlGraphicData)
	{
		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objCADGeometrySecondaryGraphicalRepresentationCID6166)
			this.objCADGeometrySecondaryGraphicalRepresentationCID6166 = new CADGeometrySecondaryGraphicalRepresentation_CID6166();
		this.objCADGeometrySecondaryGraphicalRepresentationCID6166.setCADGeometrySecondaryGraphicalRepresentation(enumCADGeometrySecondaryGraphicalRepresentation);

		String strCM = objCADGeometrySecondaryGraphicalRepresentationCID6166.getCodeMeaning();
		String strCV = objCADGeometrySecondaryGraphicalRepresentationCID6166.getCodeValue();
		String strCSD = objCADGeometrySecondaryGraphicalRepresentationCID6166.getCodingSchemeDesignator();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createSCOORDNode(arrPosition, strCM, strCV, strCSD, arrFlGraphicData, enumGraphicType);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for Identifying Segment.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param string 
	 * @param enumStatusOfResults Enumerated value for StatusOfResults
	 */
	public void setIdentifyingSegment(int[] arrPosition, String[] string)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ColonCADGeometry.IDENTIFYING_SEGMENT.getValue();
		String strCodeValue = EnumCV_ColonCADGeometry.IDENTIFYING_SEGMENT_112229.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createImageNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, "", "", string, "", "");
		getSRTree().addChild(objContentSequenceItem);
	}

}
