Commit d0504c4a authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Single-meausure points no longer deleted when running validity check and delete=False (Ref#2342)

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6527 41f8697f-d340-4b68-9986-7bafba869bb8
parent 1b7393f2
Loading
Loading
Loading
Loading
+39 −1
Original line number Diff line number Diff line
@@ -351,6 +351,43 @@ void IsisMain() {
 *
 * @return Whether or not the point should be deleted
 */

bool shouldDelete(ControlPoint *point){

    if(!deleteIgnored)
        return false;


    else{

        if ( point->GetNumMeasures() == 0 && !preservePoints)
            return true;


        if (point->GetType() != ControlPoint::Fixed && point->GetNumMeasures()< 2 ){

            if(preservePoints  && point->GetNumMeasures() == 1)
                return false;

            return true;  //deleteIgnore = TRUE or else we would not be here
        }


        if( point->IsIgnored() )
            return true;

        return false;

    }


}





/*
bool shouldDelete(ControlPoint *point) {
  // If the point only has one measure, then unless it's a fixed point or the
  // user wishes to preserve such points, it should be deleted. As a side
@@ -372,7 +409,7 @@ bool shouldDelete(ControlPoint *point) {
  // Otherwise, the point looks good
  return false;
}

*/

/**
 * Set the point at the given index in the control network to ignored, and add
@@ -1028,3 +1065,4 @@ void EditDefFile(void) {
  GuiEditFile::EditFile(ui, sDefFile);
}

+9 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>

<application name="cnetedit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">
<application name="cnetedit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">

  <brief>
    Edit control networks
@@ -136,6 +138,11 @@
      measure is removed, the whole point is only removed if IGNOREALL is true. 
      Fixes #2238.
    </change>
    <change name="Tyler Wilson" date="2016-01-04">
      Fixed a problem with single measure points being deleted when running a validity
      check even when delete = false.  Zero measure points are now deleted no matter what.
      Ref #2342.
    </change>
  </history>

  <category>
@@ -435,3 +442,4 @@
  </groups>

</application>
+13 −0
Original line number Diff line number Diff line
APPNAME = cnetedit

include $(ISISROOT)/make/isismake.tsts

commands:
	$(LS) $(INPUT)/*.cub > $(OUTPUT)/list.lis;
	$(APPNAME) CNET=$(INPUT)/cnet.net \
	LOG=$(OUTPUT)/log.txt \
	CUBELIST=$(OUTPUT)/list.lis \
	POINTLIST=$(INPUT)/points.lis \
	DELETE = false \
	ONET=$(OUTPUT)/cnet2.net > /dev/null;
	$(RM) $(OUTPUT)/list.lis;
+14 −0
Original line number Diff line number Diff line
APPNAME = cnetedit

include $(ISISROOT)/make/isismake.tsts

commands:
	$(LS) $(INPUT)/*.cub > $(OUTPUT)/list.lis;
	$(APPNAME) CNET=$(INPUT)/cnet.net \
	LOG=$(OUTPUT)/log.txt \
	CUBELIST=$(OUTPUT)/list.lis \
	POINTLIST=$(INPUT)/points.lis \
	DELETE = true \
	PRESERVE = true \
	ONET=$(OUTPUT)/cnet2.net > /dev/null;
	$(RM) $(OUTPUT)/list.lis;