OSDN Git Service

[denncoCreator] Implement plugin cell edit feature. The work is in progress.
[dennco/denncoCreator.git] / Source / dcaxonterminal.cpp
1 //  Copyright (c) 2012 Dennco Project
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 //
17 //  Created by tkawata on Sep-30, 2012.
18 //
19 #include "dcaxonterminal.h"
20
21 #include "dcvcomponent.h"
22 #include "dcaxon.h"
23 #include "dcreceptor.h"
24
25 DCAxonTerminal::DCAxonTerminal(DCAxon *theOwner) : TKAxonTerminal(theOwner), mVComponent(NULL),
26     mIsViewReceptorPointUpdated(false), mIsViewAxonPointUpdated(false)
27
28 {
29 }
30
31 DCAxonTerminal::~DCAxonTerminal()
32 {
33     if (mVComponent)
34     {
35         delete mVComponent;
36         mVComponent = NULL;
37     }
38 }
39
40 DCReceptor* DCAxonTerminal::getTarget() const
41 {
42     return dynamic_cast<DCReceptor*>(mTarget);
43 }
44
45 void DCAxonTerminal::setViewMatrixForAxonPoint(const float matrix[])
46 {
47     for (int i = 0; i < 16; i++)
48     {
49         mViewAxonPointMatrix[i] = matrix[i];
50     }
51
52     mIsViewAxonPointUpdated = true;
53 }
54
55 void DCAxonTerminal::setViewMatrixForReceptorPoint(const float matrix[])
56 {
57     for (int i = 0; i < 16; i++)
58     {
59         mViewReceptorPointMatrix[i] = matrix[i];
60     }
61
62     mIsViewReceptorPointUpdated = true;
63 }
64
65 void DCAxonTerminal::resetViewPoinMatrices()
66 {
67     mIsViewAxonPointUpdated = false;
68     mIsViewReceptorPointUpdated = false;
69 }
70