/*******************************************************************************
 *  Copyright 2017-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.mammographycadsriodtemplates;

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
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_MammographyCADGeometryTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADGeometryTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents MammographyCADGeometryTemplate - TID4021
 */
public class MammographyCADGeometryTemplate_TID4021 extends Template
{

	/**
	 * Object of CADGeometrySecondaryGraphicalRepresentation_CID6166
	 */
	private CADGeometrySecondaryGraphicalRepresentation_CID6166 objCADGeometrySecondaryGraphicalRepresentationCID6166;
	
	/**
	 * Instantiates MammographyCADGeometryTemplate_TID4021 Template.
	 * @param objTree Object of SRTree.
	 */
	public MammographyCADGeometryTemplate_TID4021(SRTree objTree)
	{
		super(objTree);
	}

	/**
	 * Sets value for CADGeometrySecondaryGraphicalRepresentation.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCADGeometrySecondaryGraphicalRepresentation Enumerated value for CADGeometrySecondaryGraphicalRepresentation.
	 * @param enumGraphicType 
	 * @param arrFlGraphicData 
	 * @param enumGraphicTypeString 
	 */
	public void setCADGeometrySecondaryGraphicalRepresentation(int[] arrPosition, EnumCM_CADGeometrySecondaryGraphicalRepresentation enumCADGeometrySecondaryGraphicalRepresentation, EnumGraphicType enumGraphicType, float[] arrFlGraphicData, EnumGraphicType enumGraphicTypeString)
	{
		/**
		 * Setting value for Topographical modifier
		 */
		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();
		String strSNOMEDCTID = objCADGeometrySecondaryGraphicalRepresentationCID6166.getSNOMEDCTID();

		/**
		 * Creating a node of Value Type SCOORD and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createSCOORDNode(arrPosition, strCM, strCV, strCSD, arrFlGraphicData, enumGraphicTypeString, strSNOMEDCTID, enumGraphicType);
		getSRTree().addChild(objContentSequenceItem);
		
	}
	
	/**
	 * Sets the value for Center
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrFlGraphicData Float array for FlGraphicData.
	 * @param enumGraphicType Enumerated value for GraphicType.
	 */
	public void setCenter(int[] arrPosition, float []arrFlGraphicData, EnumGraphicType enumGraphicType)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADGeometryTemplate.CENTER.getValue();
		String strCodeValue = EnumCV_MammographyCADGeometryTemplate.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 arrFlGraphicData Float array for FlGraphicData.
	 * @param enumGraphicType Enumerated value for GraphicType.
	 */
	public void setOutline(int[] arrPosition, float []arrFlGraphicData, EnumGraphicType enumGraphicType)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADGeometryTemplate.OUTLINE.getValue();
		String strCodeValue = EnumCV_MammographyCADGeometryTemplate.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);
	}
}
