// $Revision: 1.2 $ // SelectionTarget.C // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. #include "SelectionTarget.h" #ifndef TaligentSamples_SELECTIONMAPPING #include "SelectionMapping.h" #endif #ifndef Taligent_ASSERTIONS #include #endif //................................................................................ TaligentTypeExtensionMacro_Abstract(TSelectionTarget) TSelectionTarget::TSelectionTarget(MSelectionMapping* mapping, MFeedbacker* feedbacker) : TSelectionToolTarget(feedbacker, mapping), fSelection(NIL), fArea() { } TSelectionTarget::~TSelectionTarget() { } TGArea TSelectionTarget::GetSelectedArea() const { return fArea; } void TSelectionTarget::SetSelectedArea(const TGPoint& where) { TGPoint dummy(where); GetCoordMapping()->TransformPoint(dummy); fSelection = GetMapping()->CreateSelectionFromPoint(dummy); fArea = TGArea(); Assertion(fSelection != NIL, "TSelectionTarget::SetSelectedArea"); } void TSelectionTarget::SetSelectedArea(const TGArea& area) { fArea = area; TGArea dummy(area); dummy.TransformBy(*GetCoordMapping()); fSelection = GetMapping()->CreateSelectionFromArea(dummy); Assertion(fSelection != NIL, "TSelectionTarget::SetSelectedArea"); } TModelSelection* TSelectionTarget::GetSelection() const { return fSelection; }