Salome HOME
PAL10125 - by double click on reference original object becomes selected
[modules/gui.git] / src / GLViewer / GLViewer_CoordSystem.cxx
index 85502237ce52b5dca0066a7d54f26431272e4fef..0fbcb3b6bc8c15182d980c6b6cc688a23576c291 100644 (file)
@@ -1,14 +1,19 @@
-/***************************************************************************
-**  Class:   GLViewer_CoordSystem
-**  Descr:   
-**  Module:  GLViewer
-**  Created: UI team, 03.09.02
-****************************************************************************/
-
-//#include <GLViewerAfx.h>
+// File:      GLViewer_Context.cxx
+// Created:   November, 2004
+// Author:    OCC team
+// Copyright (C) CEA 2004
+
+//================================================================
+// Class       : GLViewer_CoordSystem
+// Description : Class implementing mathematical model of 2D coordinate system 
+//================================================================
 #include "GLViewer_CoordSystem.h"
 #include <math.h>
 
+//=======================================================================
+// Function: GLViewer_CoordSystem
+// Purpose :
+//=======================================================================
 GLViewer_CoordSystem::GLViewer_CoordSystem( CSType aType, double X0, double Y0, 
                                             double XUnit, double YUnit, double Rotation )
 {
@@ -18,24 +23,40 @@ GLViewer_CoordSystem::GLViewer_CoordSystem( CSType aType, double X0, double Y0,
     setRotation( Rotation );
 }
 
+//=======================================================================
+// Function: getOrigin
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::getOrigin( double& x, double& y ) const
 {
     x = myX0;
     y = myY0;
 }
 
+//=======================================================================
+// Function: setOrigin
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::setOrigin( double x, double y )
 {
     myX0 = x;
     myY0 = y;
 }
 
+//=======================================================================
+// Function: getUnits
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::getUnits( double& x, double& y ) const
 {
     x = myXUnit;
     y = myYUnit;
 }
 
+//=======================================================================
+// Function: setUnits
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::setUnits( double x, double y )
 {
     if( x>0 )
@@ -48,27 +69,46 @@ void GLViewer_CoordSystem::setUnits( double x, double y )
     else
         myYUnit = 1.0;
 }
-
+//=======================================================================
+// Function: getRotation
+// Purpose :
+//=======================================================================
 double GLViewer_CoordSystem::getRotation() const
 {
     return myRotation;
 }
 
+//=======================================================================
+// Function: setRotation
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::setRotation( double rotation )
 {
     myRotation = rotation;
 }
 
+//=======================================================================
+// Function: getType
+// Purpose :
+//=======================================================================
 GLViewer_CoordSystem::CSType GLViewer_CoordSystem::getType() const
 {
     return myType;
 }
 
+//=======================================================================
+// Function: setType
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::setType( CSType type )
 {
     myType = type;
 }
 
+//=======================================================================
+// Function: toReference
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::toReference( double& x, double& y )
 {
     if( myType==Cartesian )
@@ -86,6 +126,10 @@ void GLViewer_CoordSystem::toReference( double& x, double& y )
     }
 }
 
+//=======================================================================
+// Function: fromReference
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::fromReference( double& x, double& y )
 {
     x = (x - myX0) / myXUnit;
@@ -122,12 +166,20 @@ void GLViewer_CoordSystem::fromReference( double& x, double& y )
     }
 }
 
+//=======================================================================
+// Function: transform
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::transform( GLViewer_CoordSystem& aSystem, double& x, double& y )
 {
     toReference( x, y );
     aSystem.fromReference( x, y );
 }
 
+//=======================================================================
+// Function: getStretching
+// Purpose :
+//=======================================================================
 void GLViewer_CoordSystem::getStretching( GLViewer_CoordSystem& aSystem, double& theX, double& theY )
 {
     theX = myXUnit / aSystem.myXUnit;