degate  0.1.2
PlacedLogicModelObject.cc
Go to the documentation of this file.
00001 /* -*-c++-*-
00002 
00003  This file is part of the IC reverse engineering tool degate.
00004 
00005  Copyright 2008, 2009, 2010 by Martin Schobert
00006  Copyright 2012 Robert Nitsch
00007 
00008  Degate is free software: you can redistribute it and/or modify
00009  it under the terms of the GNU General Public License as published by
00010  the Free Software Foundation, either version 3 of the License, or
00011  any later version.
00012 
00013  Degate is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  GNU General Public License for more details.
00017 
00018  You should have received a copy of the GNU General Public License
00019  along with degate. If not, see <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #include "globals.h"
00024 #include "LogicModelObjectBase.h"
00025 #include "Net.h"
00026 #include "Layer.h"
00027 #include "LogicModel.h"
00028 #include "PlacedLogicModelObject.h"
00029 
00030 using namespace degate;
00031 
00032 PlacedLogicModelObject::PlacedLogicModelObject() : highlight_state(HLIGHTSTATE_NOT) {
00033 }
00034 
00035 PlacedLogicModelObject::~PlacedLogicModelObject() {
00036 }
00037 
00038 void PlacedLogicModelObject::cloneDeepInto(DeepCopyable_shptr destination, oldnew_t *oldnew) const {
00039   ColoredObject::cloneDeepInto(destination, oldnew);
00040   LogicModelObjectBase::cloneDeepInto(destination, oldnew);
00041   
00042   auto clone = std::dynamic_pointer_cast<PlacedLogicModelObject>(destination);
00043   assert(clone.get () != 0);
00044   clone->highlight_state = highlight_state;
00045   clone->layer = std::dynamic_pointer_cast<Layer>(layer->cloneDeep(oldnew));
00046 }
00047 
00048 PlacedLogicModelObject::HIGHLIGHTING_STATE PlacedLogicModelObject::get_highlighted() const {
00049   return highlight_state;
00050 }
00051 
00052 bool PlacedLogicModelObject::is_highlighted() const {
00053   return highlight_state != PlacedLogicModelObject::HLIGHTSTATE_NOT;
00054 }
00055 
00056 void PlacedLogicModelObject::set_highlighted(PlacedLogicModelObject::HIGHLIGHTING_STATE state) {
00057   highlight_state = state;
00058 }
00059 
00060 
00061 void PlacedLogicModelObject::set_layer(std::shared_ptr<Layer> layer) {
00062   this->layer = layer;
00063 }
00064 
00065 std::shared_ptr<Layer> PlacedLogicModelObject::get_layer() {
00066   return layer;
00067 }
00068 
00069 void PlacedLogicModelObject::notify_shape_change() {
00070 
00071   if(layer != NULL && has_valid_object_id()) {
00072     layer->notify_shape_change(get_object_id());
00073   }
00074 }