Example #1
0
test_case(p1, CarryOut) {
  assert_eq(F, CarryOut(F, F, F));
  assert_eq(F, CarryOut(T, F, F));
  assert_eq(F, CarryOut(F, T, F));
  assert_eq(T, CarryOut(T, T, F));
  assert_eq(F, CarryOut(F, F, T));
  assert_eq(T, CarryOut(T, F, T));
  assert_eq(T, CarryOut(F, T, T));
  assert_eq(T, CarryOut(T, T, T));
}
Example #2
0
/********************************************************************************************
>	BOOL OpMakeSegmentsCurves::ProcessSegment(NodePath* pPath, INT32* Index, INT32 PrevIndex)

	Author:		Peter_Arnold (Xara Group Ltd) <*****@*****.**>
	Created:	16/8/95
	Inputs:		pPath - points to the path to process
				Index - index of the PT_LINETO segment to change into lines
				PrevIndex - index of the previous endpoint (other end of the segment to process)
	Outputs:	Index is changed to point to the new index of the end of the segment
	Returns:	TRUE/FALSE for success/failure
	Purpose:	Performs the make selected segments into lines operation. 
	Errors:		-
	SeeAlso:	OpBaseConvertPathSegment::Do
********************************************************************************************/
BOOL OpMakeSegmentsCurves::ProcessSegment(NodePath* pPath, INT32* Index, INT32 PrevIndex)
{
	// Get the path pointers
	PathVerb* Verbs;
	PathFlags* Flags;
	DocCoord* Coords;
	pPath->InkPath.GetPathArrays(&Verbs, &Coords, &Flags);

	// Quick check
	ERROR2IF(((Verbs[*Index] & ~PT_CLOSEFIGURE) != PT_LINETO), FALSE, "Unknown segment encountered");
	ERROR2IF(((PrevIndex+1) != *Index), FALSE, "Points between segment start and end");

	BOOL ok = CarryOut(*Index, PrevIndex, pPath, this, &UndoActions);
	*Index = PrevIndex + 3;

	return ok;
}