1////////////////////////////////////////////////////////////////////////////////
2// //
3// This software is supplied under the terms of a license agreement or //
4// nondisclosure agreement with Mitov Software and may not be copied //
5// or disclosed except in accordance with the terms of that agreement. //
6// Copyright(c) 2002-2016 Mitov Software. All Rights Reserved. //
7// //
8////////////////////////////////////////////////////////////////////////////////
9
10#ifndef _MITOV_SQUARE_GENERATOR_h
11#define _MITOV_SQUARE_GENERATOR_h
12
13#include <Mitov.h>
14#include "Mitov_BasicGenerator.h"
15
16namespace Mitov
17{
18 template<typename T> class TypedSquareGenerator : public Mitov::AsymmetricGenerator<T>
19 {
20 typedef Mitov::AsymmetricGenerator<T> inherited;
21
22 protected:
23 virtual void CalculateValue() override
24 {
25 if( inherited::FPhase < 0.5 + inherited::Asymmetry / 2 )
26 inherited::FValue = inherited::Offset - inherited::Amplitude;
27
28 else
29 inherited::FValue = inherited::Offset + inherited::Amplitude;
30
31 }
32
33 public:
34 using inherited::inherited;
35
36 };
37//---------------------------------------------------------------------------
38}
39
40#endif