api_alternating_keep_pattern
List of: Functions
Subjects: Patterns
Contents: Kernel

Action: Creates a new pattern by applying an alternating keep-filter to an existing pattern.

Prototype: outcome api_alternating_keep_pattern (


pattern*& pat, // created pattern


const pattern& in_pattern,// input pattern


logical keep1, // 1st keep value


logical keep2, // 2nd keep value


int which_dim, // dimension for filter


logical merge = TRUE, // merge or replace flag


AcisOptions* ao = NULL // acis options


);

Includes: #include "kernel/acis.hxx"

#include "baseutil/logical.h"

#include "kernel/kernapi/api/api.hxx"

#include "kernel/kernutil/law/pattern.hxx"

#include "kernel/kernutil/law/pattern_api.hxx"

#include "kernel/kernapi/api/acis_options.hxx"

Description: Applies an alternating keep-filter to an existing pattern, merging with any existing filter or, optionally (with merge = FALSE), replacing it. The arguments keep1 and keep2 are successive Boolean keep values. which_dim specifies the dimension in which the filter is applied.


The following code snippet gives an example of using this API.


// Create a pattern

pattern* pat = NULL;

SPAvector x_vec(4.0, 0, 0);

int num_x = 8;

SPAvector y_vec(0, 2.0, 0);

int num_y = 10;

check_outcome(result = api_linear_pattern(pat, x_vec, num_x, y_vec, num_y));


// Modify the pattern

pattern* mod_pat = NULL;

logical keep1 = FALSE;

logical keep2 = TRUE;

int which_dim = 1;

check_outcome(result = api_alternating_keep_pattern(mod_pat, *pat, keep1, keep2, which_dim));


// Create a prism

BODY* prism = NULL;

double height = 1.0;

double maj_rad = 1.0;

double min_rad = 0.5;

int num_sides = 3;

check_outcome(result = api_make_prism(height, maj_rad, min_rad, num_sides, prism));


// Apply the pattern to the prismcheck_outcome(result = api_set_entity_pattern(prism, mod_pat));


// Clean up

pat->remove();

mod_pat->remove();

Errors: The keep is NULL, the period is less than one, or the specified dimension is not consistent with the pattern dimensionality.

Library: kernel

Filename: kern/kernel/kernutil/law/pattern_api.hxx

Effect: Changes model
PDF/KERN/16FNA.PDF
HTM/DATA/KERN/KERN/16FNA/0004.HTM