//
// (C) Copyright 2003-2023 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Collections;
using System.Collections.Generic;
namespace Revit.SDK.Samples.WindowWizard.CS
{
///
/// This class will deal with all parameters related to window creation
///
public class WindowParameter
{
///
///store the family type name
///
String m_type = String.Empty;
///
/// store the height of opening
///
double m_height = 0.0;
///
/// store the width of opening
///
double m_width = 0.0;
#region Properties
///
/// get/set the Type property
///
public String Type
{
set
{
m_type = value;
}
get
{
return m_type;
}
}
///
/// get/set the Height property
///
public double Height
{
set
{
m_height = value;
}
get
{
return m_height;
}
}
///
/// get/set the Width property
///
public double Width
{
set
{
m_width = value;
}
get
{
return m_width;
}
}
#endregion
///
/// constructor of WindowParameter
///
/// indicate whether the template is metric or imperial
public WindowParameter(bool isMetric)
{
if (isMetric)
{
m_type = "NewType";
m_height = 1000;
m_width = 500;
}
else
{
m_type = "NewType";
m_height = 4.0;
m_width = 2.0;
}
}
///
/// construcion of WindowParameter
///
/// the WindowParameter
public WindowParameter(WindowParameter para)
{
if (String.IsNullOrEmpty(para.m_type))
{
m_type = "NewType";
}
m_type = para.Type + "1";
m_height = para.Height;
m_width = para.Width;
}
}
///
/// This class is used to deal with wizard parameters
///
public class WizardParameter
{
// ToDo add properties for them
///
/// store the template name
///
public String m_template = String.Empty;
///
/// store the current WindowParameter
///
private WindowParameter m_curPara = new WindowParameter(true);
///
/// store the windowparameter hashtable
///
Hashtable m_winParas = new Hashtable();
///
/// store the frame material list
///
private List m_frameMats = new List();
///
/// store the glass material list
///
private List m_GlassMats = new List();
///
/// store the glass material
///
String m_glassMat = String.Empty;
///
/// store the sash material
///
String m_sashMat = String.Empty;
///
/// store the ValidateWindowParameter
///
private ValidateWindowParameter m_validator = new ValidateWindowParameter(10, 10);
///
/// store the temp path
///
private String m_pathName = System.IO.Path.GetTempPath();
#region
///
/// get/set Validator property
///
public ValidateWindowParameter Validator
{
get
{
return m_validator;
}
set
{
m_validator = value;
}
}
///
/// get/set FrameMaterials property
///
public List FrameMaterials
{
set
{
m_frameMats = value;
}
get
{
return m_frameMats;
}
}
///
/// get/set GlassMaterials property
///
public List GlassMaterials
{
set
{
m_GlassMats = value;
}
get
{
return m_GlassMats;
}
}
///
/// get/set GlassMat property
///
public String GlassMat
{
set
{
m_glassMat = value;
}
get
{
return m_glassMat;
}
}
///
/// get/set SashMat property
///
public String SashMat
{
set
{
m_sashMat = value;
}
get
{
return m_sashMat;
}
}
///
/// get/set WinParaTab property
///
public Hashtable WinParaTab
{
get
{
return m_winParas;
}
set
{
m_winParas = value;
}
}
///
/// get/set CurrentPara property
///
public WindowParameter CurrentPara
{
get
{
return m_curPara;
}
set
{
m_curPara = value;
}
}
///
/// get/set PathName property
///
public String PathName
{
get
{
return m_pathName;
}
set
{
m_pathName = value;
}
}
#endregion
}
///
/// This class inherits from WindowParameter
///
public class DoubleHungWinPara : WindowParameter
{
///
/// store the m_inset
///
double m_inset = 0.0;
///
/// store the m_sillHeight
///
double m_sillHeight = 0.0;
#region
///
/// set/get Inset property
///
public double Inset
{
set
{
m_inset = value;
}
get
{
return m_inset;
}
}
///
/// set/get SillHeight property
///
public double SillHeight
{
set
{
m_sillHeight = value;
}
get
{
return m_sillHeight;
}
}
#endregion
///
/// constructor of DoubleHungWinPara
///
/// indicate whether the template is metric of imperial
public DoubleHungWinPara(bool isMetric)
: base(isMetric)
{
if (isMetric)
{
m_inset = 20;
m_sillHeight = 800;
}
else
{
m_inset = 0.05;
m_sillHeight = 3;
}
}
///
/// constructor of DoubleHungWinPara
///
/// DoubleHungWinPara
public DoubleHungWinPara(DoubleHungWinPara dbhungPara)
: base(dbhungPara)
{
m_inset = dbhungPara.Inset;
m_sillHeight = dbhungPara.SillHeight;
}
}
}