Commit 02351586 authored by Ole Streicher's avatar Ole Streicher

New upstream version 3.1.1

parent b9d68f71
*.[oa]
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
*~
Copyright (c) 2016, SAOImageDS9
All rights reserved.
Smithsonian Astrophysical Observatory, Cambridge, MA, USA
This code has been modified under the terms listed below and is made
available under the same terms.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Copyright 1991-2004 George A Howlett.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
......@@ -365,8 +365,21 @@ static int LowerOp(ClientData clientData, Tcl_Interp* interp,
if (graphPtr->getElement(objv[ii], &elemPtr) != TCL_OK)
return TCL_ERROR;
graphPtr->elements_.displayList->unlinkLink(elemPtr->link);
chain->linkAfter(elemPtr->link, NULL);
// look for duplicates
int ok=1;
for (ChainLink* link = Chain_FirstLink(chain);
link; link = Chain_NextLink(link)) {
Element* ptr = (Element*)Chain_GetValue(link);
if (ptr == elemPtr) {
ok=0;
break;
}
}
if (ok && elemPtr->link) {
graphPtr->elements_.displayList->unlinkLink(elemPtr->link);
chain->linkAfter(elemPtr->link, NULL);
}
}
// Append the links to end of the display list
......@@ -424,14 +437,26 @@ static int RaiseOp(ClientData clientData, Tcl_Interp* interp,
Graph* graphPtr = (Graph*)clientData;
Chain* chain = new Chain();
for (int ii=3; ii<objc; ii++) {
Element* elemPtr;
if (graphPtr->getElement(objv[ii], &elemPtr) != TCL_OK)
return TCL_ERROR;
graphPtr->elements_.displayList->unlinkLink(elemPtr->link);
chain->linkAfter(elemPtr->link, NULL);
// look for duplicates
int ok=1;
for (ChainLink* link = Chain_FirstLink(chain);
link; link = Chain_NextLink(link)) {
Element* ptr = (Element*)Chain_GetValue(link);
if (ptr == elemPtr) {
ok=0;
break;
}
}
if (ok && elemPtr->link) {
graphPtr->elements_.displayList->unlinkLink(elemPtr->link);
chain->linkAfter(elemPtr->link, NULL);
}
}
// Prepend the links to beginning of the display list in reverse order
......@@ -471,7 +496,19 @@ static int ShowOp(ClientData clientData, Tcl_Interp* interp,
return TCL_ERROR;
}
chain->append(elemPtr);
// look for duplicates
int ok=1;
for (ChainLink* link = Chain_FirstLink(chain);
link; link = Chain_NextLink(link)) {
Element* ptr = (Element*)Chain_GetValue(link);
if (ptr == elemPtr) {
ok=0;
break;
}
}
if (ok)
chain->append(elemPtr);
}
// Clear the links from the currently displayed elements
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment