InteractiveInterfaces Interface CATIIniSearchContext

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIIniSearchContext

Class to define in which context the objects will be looked for.
Role: A Search context defines the granularity with which objects will be looked for. Refer to the Scope enumeration for further details.
A context applies to a CATIIniSearchCriterion, since it defines the set of objects (usually represented in the specification tree) that will be confronted with the criterion.
Refer to the "Search Overview" technical article for further details.


Method Index


o GetNLSScope(CATUnicodeString&)
Retrieves the scope in the NLS format.
o GetReferenceObjectPath(CATPathElement*&)
Retrieves the reference object.
o GetScope(CATIIniSearchContext::Scope&)
Retrieves the enumeration value scope.
o GetTransFormatScope(CATUnicodeString&)
Retrieves the scope in the TransFormat format.
o SetScope(CATIIniSearchContext::Scope,CATPathElement*)
Sets the scope from the dedicated enumeration.
o SetScopeFromString(CATUnicodeString&)
Sets the scope from a string.

Enumerated Type Index


o Scope
Contexts value for a Search procedure.

Methods


o GetNLSScope
public virtual HRESULT GetNLSScope(CATUnicodeString& oNLSScope) = 0
Retrieves the scope in the NLS format.
Role: This methods retrieves the scope under an NLS format string, whatever the way it has been set up.

Parameters:
oNLSScope
The returned scope under an NLS format.
Returns:
S_OK if the scope has successfully been set up. E_FAIL otherwise
o GetReferenceObjectPath
public virtual HRESULT GetReferenceObjectPath(CATPathElement*& oReferenceObjectPath) = 0
Retrieves the reference object.
Role: This method retrieves the path of the reference object used when the scope has been set up through the 2-argument SetScope method.

Parameters:
oReferenceObjectPath
The path of the reference object. (The value cannot be null)
Returns:
S_OK if the scope has successfully been set up. E_FAIL otherwise
o GetScope
public virtual HRESULT GetScope(CATIIniSearchContext::Scope& oScope) = 0
Retrieves the enumeration value scope.
Role: This method retrieves the enumeration corresponding to the scope, whatever the way it has been set up.

Parameters:
oScope
The returned scope under the enumeration format.
Returns:
S_OK if the scope has successfully been set up. E_FAIL otherwise
o GetTransFormatScope
public virtual HRESULT GetTransFormatScope(CATUnicodeString& oTFScope) = 0
Retrieves the scope in the TransFormat format.
Role: This method retrieves the scope under a TransFormat format string, whatever the way it has been set up.

Parameters:
oTFScope
The returned scope under an TransFormat format.
Returns:
S_OK if the scope has successfully been set up. E_FAIL otherwise
o SetScope
public virtual HRESULT SetScope(CATIIniSearchContext::Scope iScope,
CATPathElement* iReferenceObjectPath=NULL) = 0
Sets the scope from the dedicated enumeration.
Role: This methods sets the scope through an enumeration value.

Parameters:
iScope
The scope value.
iReferenceObjectPath
  • If the chosen scope is OnSameLevel, this argument is mandatory.
    It defines the reference object for the scope: on the same level as this reference object.
  • If the chosen scope is InUIActiveObject, or FromUIActiveObjectToBottom, this argument is optional.
    It enables the user to define an object implementing the
  • CATIUIActivate, from which the search will start. It is especially useful when the search should start from an UIActivable object that is not the current UIActiveObject.
  • In all the other case, this argument must be omitted.
  • Returns:
    S_OK if the scope has successfully been set up. E_FAIL otherwise
    o SetScopeFromString
    public virtual HRESULT SetScopeFromString( const CATUnicodeString& iStringScope) = 0
    Sets the scope from a string.
    Role: This method sets the scope through a CATUnicodeString refering to either an NLS or a TransFormat context.

    Parameters:
    iStringScope
    The scope under an NLS or TransFormat format.
  • Here are different complete NLS queries that can be obtained through the Edit/Search user interface, with an English session. Those pieces of information are session's language dependent. Here under the matching between enumeration and string-format context is explained:
    • Everywhere: in Name=Johnny,all the context is all.
    • InUIActiveObject: in Name=Johnny,in the context is in. In the Name=Johnny query, there is no context. So the default one is assumed to be here.
    • FromUIActiveObjectToBottom: in Name=Johnny,from the context is from.
    • FromSelection: in Name=Johnny,sel the context is sel.
  • Here under the matching between enumeration and Transformat context is explained:
    • Everywhere: the Transformat context is all.
    • InUIActiveObject: the Transformat context is in.
    • FromUIActiveObjectToBottom: : the Transformat context is from.
    • FromSelection: : the Transformat context is sel.
  • Returns:
    • S_OK if the scope has successfully been set up.
    • E_FAIL otherwise.

    Enumerated Types


    o Scope
    enum Scope {
      Everywhere,
      InUIActiveObject,
      FromUIActiveObjectToBottom,
      FromSelection,
      OnSameLevel,
      VisibleOnScreen
    }
    
    Contexts value for a Search procedure.
    The following contexts are allowed:
    Parameters:
    Everywhere
    To look for objects located anywhere in the document.
    InUIActiveObject
    To look for objects located between the current UIActive object (called current top object) and the next UIActivable objects located below this top object (called current bottom objects). Those objects are also included in the Search process.
    In a Part document, in a Part Design context, this context will consider all the objects from the top of the specification tree, to the sketches (included). But it would not take into account the elements of each sketch.
    FromUIActiveObjectToBottom
    To look for objects located from the current top object (included in the Search process), to the very bottom of the specification tree for the current top object's branch.
    In a Product document, in a Part Design context, this context will consider all the objects from the current Part object to its constitutive sketches, and all their elements.
    FromSelection
    To look for objects located in the current set of objects of the editor (
    CATCSO ), as well as other objects located underneath in the specification tree.
    For example, let us consider a Part document where a hole object and a pad object are selected. The Search process will confront the hole, the pad, their sketches, and constitutive elements to the criterion.
    OnSameLevel
    To look for objects located on the same specification tree level as a reference object.
    This reference object is excluded from the search result.
    It is only possible to define this scope through the
    SetScope method. When doing so, the second argument of the method must be provided.
    In addition, there is no possible print out of this scope's NLS or TransFormat value.
    VisibleOnScreen
    To look for objects visible (fully or not) in the current active window.
    This context won’t take into account elements not activated, not represented (features used to build other features that appear in the specification tree but not in 3D), not in the current active filter, not in the current mask... and when the 2D mode will be activated elements not in the active plane will be excluded from the search result too.
    Caution: do not use this scope in a batch, the result would be unpredictable.

    The default scope, i.e. if no setup is made, is InUIActiveObject

    Using any scope in batch mode could lead to unpredictable result. Search engine mainly relies on visualization interfaces, which could be not used in batch mode.

    This object is included in the file: CATIIniSearchContext.h
    If needed, your Imakefile.mk should include the module: CATInteractiveInterfaces

    Copyright © 1999-2014, Dassault Systèmes. All rights reserved.