Revision 41439 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.api/src/main/java/org/gvsig/fmap/geom/Geometry.java

View differences:

Geometry.java
231 231
		public final static String COVEREDBY = "CoveredBy";
232 232
	}
233 233

  
234
	public static int BEST = 0;
234
        public interface ValidationStatus {
235

  
236
            public static final int VALID = 0;
237
            public static final int CURRUPTED = 1;
238
            public static final int UNKNOW = 2;
239
            public static final int DISCONNECTED_INTERIOR = 10;
240
            public static final int DUPLICATE_RINGS = 11;
241
            public static final int HOLE_OUTSIDE_SHELL = 12;
242
            public static final int INVALID_COORDINATE = 13;
243
            public static final int NESTED_HOLES = 14;
244
            public static final int NESTED_SHELLS = 15;
245
            public static final int RING_NOT_CLOSED = 17;
246
            public static final int RING_SELF_INTERSECTION = 18;
247
            public static final int SELF_INTERSECTION = 19;
248
            public static final int TOO_FEW_POINTS = 20;
249

  
250
            /**
251
             * True if the geoemtry are valid.
252
             * 
253
             * @return true form valid geometries
254
             */
255
            public boolean isValid();
256
            
257
            /**
258
             * Return the status code results of validate the geometry.
259
             * 
260
             * @return validation code
261
             */
262
            public int getStatusCode();
263

  
264
            /**
265
             * Return the nearest point to the problem when validate the geometry.
266
             * 
267
             * If the geometry is valid, this return null.
268
             * 
269
             * @return the nearest point to the problem or null.
270
             */
271
            public Point getProblemLocation();
272

  
273
            /**
274
             * Return a human readable message explaining the cause of the problem.
275
             * 
276
             * If the geometry is valid this is null.
277
             * 
278
             * @return the message cause of the problem.
279
             */
280
            public String getMessage();
281
        }
282
        
283
        public static int BEST = 0;
235 284
	/**
236 285
	 * North.
237 286
	 */
......
634 683
	 */
635 684
	public void scale(Point basePoint, double sx, double sy);
636 685
	
686
        /**
687
         * Check if the geometry is valid.
688
         * 
689
         * @return true if the geometry is valid.
690
         */
691
	public boolean isValid();
637 692
	
638
	
639
	
693
        /**
694
         * Check if the geometry is valid and returns the validation status.
695
         * 
696
         * @return the ValidationStatus 
697
         */
698
	public ValidationStatus getValidationStatus();
699
        
640 700
	//
641 701
	// ===============================================
642 702
	//

Also available in: Unified diff