1 // Copyright (c) 2012 Dennco Project
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.
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.
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/>.
17 // Created by tkawata on Sep-30, 2012.
19 #include "dcreceptor.h"
21 #include "dcvcomponent.h"
23 #include "dcvceditmodecursor.h"
24 #include "dcvceditmodeterminal.h"
25 #include "dcaxonterminal.h"
27 DCReceptor::DCReceptor(DCCell *owner) : TKReceptor(owner), d_vComponent(NULL), d_isTerminalVisible(true), d_editCursor(NULL)
31 DCReceptor::~DCReceptor()
40 DCAxonTerminal* DCReceptor::getTarget() const
42 return dynamic_cast<DCAxonTerminal*>(mTerminal);
45 DCCell* DCReceptor::getOwnerCell() const
47 return dynamic_cast<DCCell*>(mOwner);
50 DCVComponent* DCReceptor::getVComponent() const
55 void DCReceptor::getViewReceptorOffsetPoint(float dx, float dy, float dz,float *x, float *y, float *z) const
61 DCCell *cell = getOwnerCell();
65 cell->getViewHCrossPoint(dx,dz,&cx,&cz);
71 void DCReceptor::registerEditCursor(DCVCEditModeCursor *cursor)
73 d_editCursor = cursor;
76 void DCReceptor::unregisterEditCursor()
81 void DCReceptor::setEditingCursorViewMatrix(const float matrix[])
85 d_editCursor->getTerminal()->setViewMatrixForReceptorPoint(this, matrix);