summaryrefslogtreecommitdiff
path: root/src/pmview/togglemod.h
blob: dafd65e07f43fbc1a399cb4e5d2ad739dd05783e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * Copyright (c) 1997 Silicon Graphics, Inc.  All Rights Reserved.
 * Copyright (c) 2009 Aconex.  All Rights Reserved.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */
#ifndef _TOGGLEMOD_H_
#define _TOGGLEMOD_H_

#include <Inventor/SbString.h>
#include "modulate.h"
#include "modlist.h"

class SoSeparator;
class SoPath;
class Launch;
class Record;

class ToggleMod : public Modulate
{
private:

    ModulateList	_list;
    QString		_label;

public:

    virtual ~ToggleMod();

    ToggleMod(SoNode *obj, const char *label);

    void addMod(Modulate *mod)
    	{ _list.append(mod); }

    virtual void selectAll();
    virtual int select(SoPath *);
    virtual int remove(SoPath *);

    virtual void selectInfo(SoPath *)
	{}
    virtual void removeInfo(SoPath *)
	{}

    virtual void infoText(QString &str, bool) const
	{ str = _label; }

    virtual void refresh(bool)
    	{}
    virtual void launch(Launch &, bool) const
    	{}
    virtual void record(Record &) const
    	{}

    virtual void dump(QTextStream &) const;
    void dumpState(QTextStream &os, Modulate::State state) const;

    friend QTextStream &operator<<(QTextStream &os, const ToggleMod &rhs);

private:

    ToggleMod();
    ToggleMod(const ToggleMod &);
    const ToggleMod &operator=(const ToggleMod &);
    // Never defined
};

#endif /* _TOGGLEMOD_H_ */